- prettified the defaults files and the recent file. Now they are ordered and human readable

This commit is contained in:
Marius Stanciu
2019-02-23 19:06:20 +02:00
committed by Marius S
parent 2291a58727
commit 6d0ed52308
2 changed files with 4 additions and 3 deletions

View File

@@ -2310,7 +2310,7 @@ class App(QtCore.QObject):
return
#try:
json.dump(self.recent, f)
json.dump(self.recent, f, default=to_dict, indent=2, sort_keys=True)
# except:
# App.log.error("Failed to write to recent items file.")
# self.inform.emit('ERROR: Failed to write to recent items file.')
@@ -2684,7 +2684,7 @@ class App(QtCore.QObject):
# Save update options
try:
f = open(self.data_path + "/current_defaults.FlatConfig", "w")
json.dump(defaults, f)
json.dump(defaults, f, default=to_dict, indent=2, sort_keys=True)
f.close()
except:
self.inform.emit("[ERROR_NOTCL] Failed to write defaults to file.")
@@ -2757,7 +2757,7 @@ class App(QtCore.QObject):
# Save update options
try:
f_f_def_s = open(self.data_path + "/factory_defaults.FlatConfig", "w")
json.dump(factory_defaults, f_f_def_s)
json.dump(factory_defaults, f_f_def_s, default=to_dict, indent=2, sort_keys=True)
f_f_def_s.close()
except:
self.inform.emit("[ERROR_NOTCL] Failed to write factory defaults to file.")