From f9205fdc5559c5e056d0e17a134a0db66e71ae02 Mon Sep 17 00:00:00 2001 From: Kai Wansart Date: Fri, 2 Feb 2018 17:52:51 +0100 Subject: [PATCH] Fix Path --- app/config.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/config.py b/app/config.py index 9bf06f6..e46f9d7 100644 --- a/app/config.py +++ b/app/config.py @@ -38,8 +38,8 @@ class Config(object): data = None if(type == "settings"): print("Reading 'settings.json'") - if(os.path.isfile(path + "config/settings.json")): - with open(path + 'config/settings.json', encoding='utf-8') as data_file: + if(os.path.isfile(path + "/config/settings.json")): + with open(path + '/config/settings.json', encoding='utf-8') as data_file: try: data = json.loads(data_file.read()) except: @@ -52,8 +52,8 @@ class Config(object): self.writeConfig("settings", data) else: print("Reading 'devices.json'") - if(os.path.isfile(path + "config/devices.json")): - with open(path + 'config/devices.json', encoding='utf-8') as data_file: + if(os.path.isfile(path + "/config/devices.json")): + with open(path + '/config/devices.json', encoding='utf-8') as data_file: try: data = json.loads(data_file.read()) except: @@ -73,11 +73,11 @@ class Config(object): print(path) if(type == "settings"): print("Writing 'settings.json'") - with open(path + 'config/settings.json', 'w') as outfile: + with open(path + '/config/settings.json', 'w') as outfile: json.dump(data, outfile, indent=4) print("Settings written") else: print("Writing 'devices.json'") - with open(path + 'config/devices.json', 'w') as outfile: + with open(path + '/config/devices.json', 'w') as outfile: json.dump(data, outfile, indent=4) print("Devices written") \ No newline at end of file