WTF python suddenly function must be defined physically in the file ahead of use?
This commit is contained in:
parent
f7097af7b8
commit
cab8f0c8f1
1 changed files with 5 additions and 4 deletions
|
@ -7,6 +7,11 @@ config = configparser.ConfigParser()
|
||||||
config['pomodoro'] = {}
|
config['pomodoro'] = {}
|
||||||
pomodoro = config['pomodoro']
|
pomodoro = config['pomodoro']
|
||||||
|
|
||||||
|
def write():
|
||||||
|
with open('settings.ini', 'w') as configfile:
|
||||||
|
config.write(configfile)
|
||||||
|
|
||||||
|
|
||||||
if not os.path.isfile('settings.ini'):
|
if not os.path.isfile('settings.ini'):
|
||||||
# Set some essential initial values.
|
# Set some essential initial values.
|
||||||
# pomodoro['logfile'] = '~/Projects/agaric/python/pomodoroprompt/log/2021.csv'
|
# pomodoro['logfile'] = '~/Projects/agaric/python/pomodoroprompt/log/2021.csv'
|
||||||
|
@ -17,10 +22,6 @@ if not os.path.isfile('settings.ini'):
|
||||||
config.read('settings.ini')
|
config.read('settings.ini')
|
||||||
|
|
||||||
|
|
||||||
def write():
|
|
||||||
with open('settings.ini', 'w') as configfile:
|
|
||||||
config.write(configfile)
|
|
||||||
|
|
||||||
def pomodoro_logfile():
|
def pomodoro_logfile():
|
||||||
return config['pomodoro']['logfile']
|
return config['pomodoro']['logfile']
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue