diff --git a/pomodorodiscord/src/utils.py b/pomodorodiscord/src/utils.py index 133a1c3..cf6921e 100644 --- a/pomodorodiscord/src/utils.py +++ b/pomodorodiscord/src/utils.py @@ -6,6 +6,7 @@ mixer.init() beep = mixer.Sound('sounds/beep.mp3') +# Until user sets custom pomodoro, short break, long break durations, this gets set DEF_POMODORO_MINS = 25 DEF_SB_MINS = 5 DEF_LB_MINS = 10 @@ -20,15 +21,19 @@ def load_file(filename, on_no_file=None): return data -def load_config(): - return load_file('config.json', {'theme': 'Default'}) def load_data(): return load_file('data.json', None) + +def load_config(): + return load_file('config.json', {'theme': 'Default', 'sound': 'beep.mp3'}) + + def save_config(config): with open('config.json', 'w') as config_file: json.dump(config, config_file, indent=4) + def reload_app(): os.execl(sys.executable, sys.executable, *sys.argv)