From 792c53b2561e476f2ef2a497b2c83e67d08e2c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Sun, 24 Nov 2024 12:07:00 -0500 Subject: [PATCH 1/3] Replace another fatal error with a clearer message --- settings.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/settings.py b/settings.py index 504fe8c..4f04601 100644 --- a/settings.py +++ b/settings.py @@ -3,6 +3,7 @@ import configparser import json import os +import sys config = configparser.ConfigParser() config['pomodoro'] = {} @@ -47,4 +48,7 @@ def harvest_set_projects_clients_map(projects_clients_map = {}): write() def harvest_get_projects_clients_map(): - return json.loads(harvest['projects_clients']) + if 'projects_clients' in harvest: + return json.loads(harvest['projects_clients']) + else: + sys.exit("No project clients available; run fetch_clients_projects.py") From e4760321b2f0fca6186c6969edd5326a60c76e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Sun, 24 Nov 2024 12:09:00 -0500 Subject: [PATCH 2/3] Update to the path we now use in the default --- settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.py b/settings.py index 4f04601..f6f24e2 100644 --- a/settings.py +++ b/settings.py @@ -23,7 +23,7 @@ if not os.path.isfile('settings.ini'): pomodoro['logfile'] = '' # This path must be absolute, for some reason using ~ for home isn't working: - pomodoro['logpath'] = '/home/mlncn/Projects/agaric/python/pomodoroprompt/log/' + pomodoro['logpath'] = '/home/mlncn/Projects/python/pomodoroprompt/log/' write() config.read('settings.ini') From 72b39bc00c0a20a45621a89de748483fba2735c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Mon, 25 Nov 2024 22:56:38 -0500 Subject: [PATCH 3/3] Update settings to now-working relative path :shrug: --- settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.py b/settings.py index f6f24e2..c51fcd6 100644 --- a/settings.py +++ b/settings.py @@ -23,7 +23,7 @@ if not os.path.isfile('settings.ini'): pomodoro['logfile'] = '' # This path must be absolute, for some reason using ~ for home isn't working: - pomodoro['logpath'] = '/home/mlncn/Projects/python/pomodoroprompt/log/' + pomodoro['logpath'] = '~/Projects/python/pomodoroprompt/log/' write() config.read('settings.ini')