diff options
author | Blaine | 2020-06-20 14:43:57 +0530 |
---|---|---|
committer | Blaine | 2020-06-20 14:43:57 +0530 |
commit | f8519766d7f7fc70180411f912ed8ca15abb6a95 (patch) | |
tree | 97eb7e5570b43f3fc10628d37360351330e16bf3 /src/main/python/utils/app.py | |
parent | 7ff2d30a1c16216f3bfaebc8f71924d6a6f8ec8d (diff) | |
download | Chemical-PFD-f8519766d7f7fc70180411f912ed8ca15abb6a95.tar.gz Chemical-PFD-f8519766d7f7fc70180411f912ed8ca15abb6a95.tar.bz2 Chemical-PFD-f8519766d7f7fc70180411f912ed8ca15abb6a95.zip |
refactor and comment code
Diffstat (limited to 'src/main/python/utils/app.py')
-rw-r--r-- | src/main/python/utils/app.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/main/python/utils/app.py b/src/main/python/utils/app.py index 275ef7e..39c3674 100644 --- a/src/main/python/utils/app.py +++ b/src/main/python/utils/app.py @@ -1,5 +1,5 @@ """ -Declare fbs application so that it can be imported in other modules. +Declare fbs application and various contextual variables so that it can be imported in other modules. """ from fbs_runtime.application_context.PyQt5 import ApplicationContext @@ -9,7 +9,7 @@ from PyQt5.QtWidgets import QWidget from json import JSONEncoder, dumps, loads, dump, load from os.path import join -from resources import resources +from resources import resources #application resources defined in resources.qrc app = ApplicationContext() settings = QSettings(QSettings.IniFormat, QSettings.UserScope ,"FOSSEE", "Chemical-PFD") @@ -19,11 +19,14 @@ def fileImporter(*file): # Helper function to fetch files from src/main/resources return app.get_resource(join(*file)) +#set application stylesheet with open(fileImporter("app.qss"), "r") as stylesheet: app.app.setStyleSheet(stylesheet.read()) class JSON_Encoder: - + """ + Defines serialization methods for differnt data types for json module + """ def _encode(obj): if isinstance(obj, dict): ## We'll need to iterate not just the value that default() usually gets passed @@ -50,7 +53,9 @@ class JSON_Encoder: return obj class JSON_Typer(JSONEncoder): - + """ + derived class for redirecting encode calls + """ def default(self, o): return o.__getstate__() @@ -60,7 +65,4 @@ class JSON_Typer(JSONEncoder): def encode(self, obj): return super(JSON_Typer, self).encode(self._encode(obj)) - -importer = pyqtProperty(str, fileImporter) - -memMap = {}
\ No newline at end of file +memMap = {} #memory map for id references for loading projects
\ No newline at end of file |