This commit is contained in:
chenxuanhong
2022-01-10 15:03:58 +08:00
parent 573689a591
commit 3783ef0e75
57 changed files with 9520 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
import json
def readConfig(path):
with open(path,'r') as cf:
nodelocaltionstr = cf.read()
nodelocaltioninf = json.loads(nodelocaltionstr)
if isinstance(nodelocaltioninf,str):
nodelocaltioninf = json.loads(nodelocaltioninf)
return nodelocaltioninf
def writeConfig(path, info):
with open(path, 'w') as cf:
configjson = json.dumps(info, indent=4)
cf.writelines(configjson)