Commit e47837ac authored by Lorenz Steinert's avatar Lorenz Steinert

Merge branch 'ini_file'

parents a3b8c12c a12d9226
proto.ini
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR/.."
log() {
echo "$(basename ${BASH_SOURCE[0]}): $@"
}
install_hooks() {
git config core.hooksPath \
|| git config core.hooksPath ./dev/hooks
}
log 're/configuring hooks...'
install_hooks
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import shutil
import configparser
if 'proto.ini' not in os.listdir('.'):
shutil.copyfile('./proto.ini.default', './proto.ini')
raise SystemExit(0)
config = configparser.ConfigParser()
config.read('./proto.ini')
config_default = configparser.ConfigParser()
config_default.read('./proto.ini.default')
for i in config_default:
for j in config_default[i]:
try:
if j not in config[i]:
shutil.copyfile('./proto.ini', './proto.ini.bak')
shutil.copyfile('./proto.ini.default', './proto.ini')
raise SystemExit(0)
except:
shutil.copyfile('./proto.ini', './proto.ini.bak')
shutil.copyfile('./proto.ini.default', './proto.ini')
raise SystemExit(0)
Viviane Bauer
Julius Bohm
Ellen Bold
Carsten Dittrich
Kai Hawerkamp
Silvia Hiebel
Katharina Hilgert
Malte Koster
Sarah Anna Kova\\\\v{c}
Rutger Kuwertz
......@@ -9,11 +12,14 @@ Felix Lang
Annika Lesch
Nikolas Longen
Patrick Mischke
Kevin Mours
Tarek Moussa
Diana Remmel
Klemens Schmitt
Stephanie Roden
Fritz Schnur
Julian Schulz
Hauke Schäfer
Lorenz Steinert
Christopher Weiss
Kai-Uwe Wolf
Markus Ühlein
Tamara Azevedo
Ellen Bold
Tatjana Grün
Pascale Klaeger
Agnes Koerfer
Kevin Mours
Daniel Muschol
Lukas Neusius
Marco Tummeley
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import configparser
def main():
config = configparser.ConfigParser()
config.read('./proto.ini.default')
for i in config:
print('['+i+']')
for j in config[i]:
config[i][j] = input('Bitte gib '+j+' ein: ')
with open('proto.ini','w') as fobj:
config.write(fobj)
if __name__=="__main__":
main()
[DEFAULT]
num_cols = 4
num_cols_ext = 2
sprecher = Silvia Hibel
protokollant = Lorenz Steinert
[DEFAULT]
num_cols = 4
num_cols_ext = 2
sprecher = SPRECHER
protokollant = PROTOKOLLANT
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment