made config file more readable
This commit is contained in:
parent
4a3d52637f
commit
5de8723132
|
@ -19,7 +19,7 @@ def initSettings():
|
||||||
defaultSettings = json.load(d)
|
defaultSettings = json.load(d)
|
||||||
if not path.isfile(path.join(configFolder, 'config.json')):
|
if not path.isfile(path.join(configFolder, 'config.json')):
|
||||||
with open(path.join(configFolder, 'config.json'), 'w') as f:
|
with open(path.join(configFolder, 'config.json'), 'w') as f:
|
||||||
f.write(json.dumps(defaultSettings))
|
json.dump(f, defaultSettings, indent=2)
|
||||||
with open(path.join(configFolder, 'config.json'), 'r') as configFile:
|
with open(path.join(configFolder, 'config.json'), 'r') as configFile:
|
||||||
settings = json.load(configFile)
|
settings = json.load(configFile)
|
||||||
settingsCheck()
|
settingsCheck()
|
||||||
|
@ -38,7 +38,7 @@ def saveSettings(newSettings):
|
||||||
global settings
|
global settings
|
||||||
settings = newSettings
|
settings = newSettings
|
||||||
with open(path.join(localpaths.getConfigFolder(), 'config.json'), 'w') as configFile:
|
with open(path.join(localpaths.getConfigFolder(), 'config.json'), 'w') as configFile:
|
||||||
json.dump(settings, configFile)
|
json.dump(settings, configFile, indent=2)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def settingsCheck():
|
def settingsCheck():
|
||||||
|
|
Loading…
Reference in New Issue