Commit f6163c64 authored by Lorenz Steinert's avatar Lorenz Steinert

removed potential bug in get_{sprecher,protokollant}

parent 5e063319
......@@ -158,31 +158,29 @@ def get_fallback_fsr_extern(share_dir):
return []
def get_sprecher(config=None):
def get_sprecher(config=None, getinput=input):
"""get sprecher from user input or config"""
sprecher = ''
if config:
sprecher = config['PROTOKOLL']['Sprecher']
else:
sprecher = ''
stmp = input("Sprecher ["+sprecher+"]: ")
stmp = getinput("Sprecher ["+sprecher+"]: ")
if stmp != "":
return stmp
return sprecher
def get_protokollant(config=None):
def get_protokollant(config=None, getinput=input):
"""get protokollant from user input or config"""
protokollant = ''
if config:
protokollant = config['PROTOKOLL']['Protokollant']
else:
protokollant = ''
ptmp = input("Protokollant ["+protokollant+"]: ")
ptmp = getinput("Protokollant ["+protokollant+"]: ")
if ptmp != "":
return ptmp
return protokollant
def get_date(test=False):
def get_date(test=False, getinput=input):
"""get current date then ask user"""
if test:
date = ('01.01.2000', '2000', '01', '01')
......@@ -196,7 +194,7 @@ def get_date(test=False):
day = "0"+day
date = (day + '.' + mon + '.' + year, year, mon, day)
dtmp = input("Datum ["+date[0]+"]: ")
dtmp = getinput("Datum ["+date[0]+"]: ")
if dtmp != "":
day, mon, year = dtmp.split('.')
if len(mon) < 2:
......@@ -209,9 +207,9 @@ def get_date(test=False):
return date
def get_editor(editor):
def get_editor(editor, getinput=input):
"""get the editor to use from user input"""
etmp = input("Editor ["+editor+"]: ")
etmp = getinput("Editor ["+editor+"]: ")
if etmp != "":
return etmp
return editor
......
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