diff options
author | rahulp13 | 2020-02-16 22:56:59 +0530 |
---|---|---|
committer | rahulp13 | 2020-02-16 22:56:59 +0530 |
commit | 453c2dab78f81046fcbd42034a86c4e759a0ff68 (patch) | |
tree | 1e52dc08cfb0a86666372421d90502976715f35c /src/configuration | |
parent | 3e27f0dcb8555e1708497b48ad251e93fed93b6e (diff) | |
download | eSim-453c2dab78f81046fcbd42034a86c4e759a0ff68.tar.gz eSim-453c2dab78f81046fcbd42034a86c4e759a0ff68.tar.bz2 eSim-453c2dab78f81046fcbd42034a86c4e759a0ff68.zip |
workspace functionality
Diffstat (limited to 'src/configuration')
-rw-r--r-- | src/configuration/Appconfig.py | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/configuration/Appconfig.py b/src/configuration/Appconfig.py index 9958f819..dfe4363f 100644 --- a/src/configuration/Appconfig.py +++ b/src/configuration/Appconfig.py @@ -34,7 +34,16 @@ class Appconfig(QtGui.QWidget): """ # Home directory - home = os.path.join(os.path.expanduser("~"), "eSim-Workspace") + try: + file = open(os.path.join( + os.path.expanduser("~"), ".esim/workspace.txt"), 'r' + ) + workspace_check, home = file.readline().split(' ', 1) + file.close() + except IOError: + home = os.path.join(os.path.expanduser("~"), "eSim-Workspace") + workspace_check = 0 + default_workspace = {"workspace": home} # Current Project detail current_project = {"ProjectName": None} @@ -44,12 +53,15 @@ class Appconfig(QtGui.QWidget): workspace_text = "eSim stores your project in a folder called " workspace_text += "eSim-Workspace. You can choose a different " workspace_text += "workspace folder to use for this session." + procThread_list = [] - proc_dict = {} - # holds the pids of all external windows corresponds to the current project + proc_dict = {} # hold pids of all external windows of the current project dock_dict = {} # holds all dockwidgets - dictPath = os.path.join(os.path.expanduser("~"), ".projectExplorer.txt") - noteArea = {} + dictPath = {"path": os.path.join( + default_workspace["workspace"], ".projectExplorer.txt") + } + + noteArea = {"Note" : []} parser_esim = SafeConfigParser() parser_esim.read( @@ -76,7 +88,7 @@ class Appconfig(QtGui.QWidget): print(str(e)) try: - project_explorer = json.load(open(dictPath)) + project_explorer = json.load(open(dictPath["path"])) except BaseException: project_explorer = {} process_obj = [] |