Commit 476d5cfa authored by Lorenz Steinert's avatar Lorenz Steinert

renamed DEFAULT section in proto.ini.default to PROTOKOLL and made the changes...

renamed DEFAULT section in proto.ini.default to PROTOKOLL and made the changes to proto.py and esme.py
parent b10f7ad1
......@@ -145,7 +145,7 @@ def get_fallback_fsr_extern(share_dir):
def get_sprecher(config=None):
"""get sprecher from user input or config"""
if config:
sprecher = config['DEFAULT']['Sprecher']
sprecher = config['PROTOKOLL']['Sprecher']
else:
sprecher = ''
stmp = input("Sprecher ["+sprecher+"]: ")
......@@ -157,7 +157,7 @@ def get_sprecher(config=None):
def get_protokollant(config=None):
"""get protokollant from user input or config"""
if config:
protokollant = config['DEFAULT']['Protokollant']
protokollant = config['PROTOKOLL']['Protokollant']
else:
protokollant = ''
ptmp = input("Protokollant ["+protokollant+"]: ")
......@@ -245,10 +245,10 @@ def get_share(rundir, config=None, sharedir=None):
print(sharedir + ': Not a Directory')
sys.exit(2)
elif config:
if os.path.isdir(config['DEFAULT']['share']):
return config['DEFAULT']['share']
if os.path.isdir(config['PROTOKOLL']['share']):
return config['PROTOKOLL']['share']
else:
print(config['DEFAULT']['share'] + ': Not a Directory')
print(config['PROTOKOLL']['share'] + ': Not a Directory')
sys.exit(2)
elif os.path.isdir(os.path.join(rundir, '../share')):
return os.path.join(rundir, '../share')
......@@ -267,10 +267,10 @@ def get_path(rundir, config=None, path=None):
print(path + ': Not a Directory')
sys.exit(2)
elif config:
if os.path.isdir(config['DEFAULT']['path']):
return config['DEFAULT']['path']
if os.path.isdir(config['PROTOKOLL']['path']):
return config['PROTOKOLL']['path']
else:
print(config['DEFAULT']['path'] + ': Not a Directory')
print(config['PROTOKOLL']['path'] + ': Not a Directory')
sys.exit(2)
elif os.path.isdir(os.path.join(rundir, '../..')):
return os.path.join(rundir, '../..')
......
......@@ -172,6 +172,7 @@ if __name__ == "__main__":
RUNDIR = os.path.dirname(os.path.realpath(__file__))
OPT = build_parser()
CONFIG = get_config(RUNDIR, OPT.config)
SHARE_DIR = get_share(RUNDIR, CONFIG, OPT.sharedir)
LDAP_SERVER = get_ldap_server(CONFIG, OPT.server)
LDAP_SERVER_BASE = get_ldap_base(CONFIG, OPT.base)
......@@ -185,8 +186,8 @@ if __name__ == "__main__":
'FSRN': re.compile('%%FSRNAME')}
if CONFIG:
NUM_COLS = CONFIG['DEFAULT'].getint('NUM_COLS')
NUM_COLS_EXT = CONFIG['DEFAULT'].getint('NUM_COLS_EXT')
NUM_COLS = CONFIG['PROROKOLL'].getint('NUM_COLS')
NUM_COLS_EXT = CONFIG['PROTOKOLL'].getint('NUM_COLS_EXT')
else:
NUM_COLS = 5
NUM_COLS_EXT = 5
......
[DEFAULT]
[PROTOKOLL]
num_cols = 5
num_cols_ext = 5
sprecher = Silvia Hiebel
......
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