|
@@ -1,4 +1,4 @@
|
|
|
-from json import load
|
|
|
+from json import load, dump
|
|
|
from os.path import exists
|
|
|
|
|
|
from pycs.observable import ObservableDict
|
|
@@ -24,3 +24,10 @@ class ApplicationStatus(ObservableDict):
|
|
|
'projects': [],
|
|
|
'jobs': []
|
|
|
})
|
|
|
+
|
|
|
+ # subscribe to settings change to write it to file
|
|
|
+ self['settings'].subscribe(self.__write_settings_to_file)
|
|
|
+
|
|
|
+ def __write_settings_to_file(self, settings):
|
|
|
+ with open(self.__path_to_settings_json, 'w') as settings_json:
|
|
|
+ dump(settings, settings_json, indent=4)
|