Set and get don't work symetrically for config parser sections bwahahaha

This commit is contained in:
mlncn 2021-05-02 23:19:40 -04:00
parent 206530b235
commit 0077a27da0

View file

@ -9,7 +9,7 @@ pomodoro = config['pomodoro']
if not os.path.isfile('settings.ini'):
# Set some essential initial values.
pomodoro['logfile'] = '~/Projects/agaric/python/pomodoroprompt/logs/2021.csv'
pomodoro['logfile'] = '~/Projects/agaric/python/pomodoroprompt/log/2021.csv'
write()
config.read('settings.ini')
@ -22,9 +22,9 @@ def write():
def pomodoro_logfile():
return config['pomodoro']['logfile']
def pomodoro_latest_recorded(value = None):
if value:
pomodoro.set('latest_recorded', value)
def pomodoro_latest_recorded(timestamp = None):
if timestamp:
config.set('pomodoro', 'latest_recorded', str(timestamp))
write()
else:
return pomodoro.get('latest_recorded', None)