Update settings.py

Making it possible to auto-create a hwparam.json if not exists.
This commit is contained in:
keerttttt 2021-12-10 12:29:08 +01:00 committed by GitHub
parent 7cf612fb1a
commit 05f71327c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,10 @@ class hwparam:
if "meid" in self.paramsetting:
if meid!=self.paramsetting["meid"]:
self.paramsetting = {}
else:
self.paramsetting = {};
self.paramsetting["meid"] = meid;
open(self.paramfile, "w").write(json.dumps(self.paramsetting))
def loadsetting(self,key:str):
if self.paramsetting is not None: