Commit cc64912a authored by Lorenz Steinert's avatar Lorenz Steinert

added hardcoded defaults so it is able to run without any ini files

parent 5d7933b5
......@@ -208,8 +208,13 @@ def get_config(rundir, config_path=None, default=False):
config = configparser.ConfigParser()
config.read(os.path.join(rundir, '../etc/proto.ini'))
return config
elif os.path.isfile(os.path.join(rundir, '../etc/proto.ini.default')):
print('No non default ini file found using default.')
config = configparser.ConfigParser()
config.read(os.path.join(rundir, '../etc/proto.ini.default'))
return config
else:
print('No ini file found. Using defaults.')
print('No ini file found. Using hardcoded defaults.')
return None
......
......@@ -161,8 +161,12 @@ if __name__ == "__main__":
'ACRON': re.compile('%%ACRONAME'),
'FSRN': re.compile('%%FSRNAME')}
NUM_COLS = CONFIG['DEFAULT'].getint('NUM_COLS')
NUM_COLS_EXT = CONFIG['DEFAULT'].getint('NUM_COLS_EXT')
if CONFIG:
NUM_COLS = CONFIG['DEFAULT'].getint('NUM_COLS')
NUM_COLS_EXT = CONFIG['DEFAULT'].getint('NUM_COLS_EXT')
else:
NUM_COLS = 5
NUM_COLS_EXT = 5
TABDEF = "||"
......@@ -177,8 +181,12 @@ if __name__ == "__main__":
print("Wenn der Standardwert (in []) stimmt einfach Enter!\n")
# get data form user
SPRECHER = get_sprecher(CONFIG['DEFAULT']['Sprecher'])
PROTOKOLLANT = ESME.get_protokollant_ldap(CONFIG['DEFAULT']['Protokollant'])
if CONFIG:
SPRECHER = get_sprecher(CONFIG['DEFAULT']['Sprecher'])
PROTOKOLLANT = ESME.get_protokollant_ldap(CONFIG['DEFAULT']['Protokollant'])
else:
SPRECHER = get_sprecher('')
PROTOKOLLANT = ESME.get_protokollant_ldap('')
DATE = get_date(OPT.test)
FSR = [ESME.get_fsr_ldap(SHARE_DIR),
......
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