summaryrefslogtreecommitdiff
path: root/settings.py
diff options
context:
space:
mode:
Diffstat (limited to 'settings.py')
-rw-r--r--settings.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/settings.py b/settings.py
index c5ed5c7..e94dbe2 100644
--- a/settings.py
+++ b/settings.py
@@ -1,14 +1,14 @@
import json
+from logging import exception
-settingsJSON = open('settings.json')
+def getSettings(settingSection):
+ try:
+ settingsJSON = open("settings.json", "r")
+ except FileNotFoundError:
+ exception("settings.json not found make sure it exists in this folder")
-settings = json.load(settingsJSON)
+ settings = json.load(settingsJSON)
+ settingsJSON.close()
-calendars = settings["calendars"]
-weather = settings["weather"]
-news = settings["news"]
-modules = settings["modules"]
-general = settings["general"]
-lineWidth = settings["general"]["Line Width"]
+ return settings[settingSection]
-settingsJSON.close()