Преглед изворни кода

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

Marius Stanciu пре 7 година
родитељ
комит
6d0ed52308
2 измењених фајлова са 4 додато и 3 уклоњено
  1. 3 3
      FlatCAMApp.py
  2. 1 0
      README.md

+ 3 - 3
FlatCAMApp.py

@@ -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.")

+ 1 - 0
README.md

@@ -12,6 +12,7 @@ CAD program, and create G-Code for Isolation routing.
 24.02.2019
 
 - fixed a small bug in the Tool Solder Paste: the App don't take into consideration pads already filled with solder paste.
+- prettified the defaults files and the recent file. Now they are ordered and human readable
 
 23.02.2019