]> jfr.im git - erebus.git/blobdiff - modules/userinfo.py
userinfo - create json file if it doesnt exist
[erebus.git] / modules / userinfo.py
index b77f4d0f3339e45d291004877b5098d385bfd1ab..8cb8dfa43ec0e35b2366710d4902a9995b43b87e 100644 (file)
@@ -29,7 +29,10 @@ import json
 def gotParent():
        global jsonfile, db
        jsonfile = parent.cfg.get('userinfo', 'jsonpath', default="./modules/userinfo.json")
-       db = json.load(open(jsonfile, "r"))
+       try:
+               db = json.load(open(jsonfile, "r"))
+       except:
+               db = {}
 def closeshop():
        if json is not None and json.dump is not None:
                json.dump(db, open(jsonfile, "w"))#, indent=4, separators=(',', ': '))