From 0077a27da025a3f2d8964d79639a6e490cc480d3 Mon Sep 17 00:00:00 2001 From: mlncn Date: Sun, 2 May 2021 23:19:40 -0400 Subject: [PATCH] Set and get don't work symetrically for config parser sections bwahahaha --- settings.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/settings.py b/settings.py index b3fc6a3..8228ad7 100644 --- a/settings.py +++ b/settings.py @@ -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)