diff --git a/cfg/config.json b/cfg/config.json index 91ba495..2215deb 100644 --- a/cfg/config.json +++ b/cfg/config.json @@ -1 +1 @@ -{"pwdfilename": "eg/pwdfile.json", "secret": "5MrW89mydi5SU9X0w7nSFlk-g5ERyKDlN4-N2z6ZR7M="} \ No newline at end of file +{"pwdfilename": "/Volumes/GMGAUTHIER/keys/pwdfile.json", "secret": null} \ No newline at end of file diff --git a/configuration.py b/configuration.py index b8b8686..939aded 100644 --- a/configuration.py +++ b/configuration.py @@ -3,6 +3,7 @@ import json class Config: def __init__(self): + self.cfg_file = '/Volumes/GMGAUTHIER/keys/pwdtools/config.json' self.data = self.read() def get_pwdfilename(self): @@ -19,12 +20,10 @@ class Config: self.data["secret"] = secret self.write(self.data) - @staticmethod - def read(): - with open('cfg/config.json', mode="r") as cfgfile: + def read(self): + with open(self.cfg_file, mode="r") as cfgfile: return json.load(cfgfile) - @staticmethod - def write(keys): - with open('cfg/config.json', mode="w") as cfgfile: + def write(self, keys): + with open(self.cfg_file, mode="w") as cfgfile: cfgfile.write(json.dumps(keys))