summaryrefslogtreecommitdiff
path: root/src/configuration
diff options
context:
space:
mode:
authorRahul P2020-03-04 17:01:11 +0530
committerGitHub2020-03-04 17:01:11 +0530
commit8ffe81b36caa259151978de0434e4e0c5c32d217 (patch)
tree32202454d13dfabbf6556e98987f2a9632619ea9 /src/configuration
parente40317e709c220176fc5b7edf23d4434504335b0 (diff)
parent13f3bcfda9416624cebbf5705de398e8efcad344 (diff)
downloadeSim-8ffe81b36caa259151978de0434e4e0c5c32d217.tar.gz
eSim-8ffe81b36caa259151978de0434e4e0c5c32d217.tar.bz2
eSim-8ffe81b36caa259151978de0434e4e0c5c32d217.zip
Merge pull request #132 from rahulp13/master
major changes
Diffstat (limited to 'src/configuration')
-rw-r--r--src/configuration/Appconfig.py57
-rw-r--r--src/configuration/browser/UserManual.py20
2 files changed, 39 insertions, 38 deletions
diff --git a/src/configuration/Appconfig.py b/src/configuration/Appconfig.py
index 38a55595..6a10f3d7 100644
--- a/src/configuration/Appconfig.py
+++ b/src/configuration/Appconfig.py
@@ -1,5 +1,4 @@
# =========================================================================
-#
# FILE: Appconfig.py
#
# USAGE: ---
@@ -11,12 +10,12 @@
# BUGS: ---
# NOTES: ---
# AUTHOR: Fahim Khan, fahim.elex@gmail.com
+# MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in
# ORGANIZATION: eSim team at FOSSEE, IIT Bombay.
-# CREATED: Wednesday 04 February 2015
-# REVISION: ---
+# CREATED: Tuesday 24 February 2015
+# REVISION: Friday 14 February 2020
# =========================================================================
-
from PyQt4 import QtGui
import os
import json
@@ -31,26 +30,38 @@ class Appconfig(QtGui.QWidget):
This class also contains function for
- Printing error.
- Showing warnings.
- - Dispalying information.
+ - Displaying information.
"""
# 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}
# Current Subcircuit detail
current_subcircuit = {"SubcircuitName": None}
# Workspace detail
- workspace_text = '''eSim stores your project in a folder called a \
- eSim-Workspace. You can choose a different workspace folder to use\
- for this session.'''
+ 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(
@@ -63,11 +74,21 @@ class Appconfig(QtGui.QWidget):
# Try catch added, since eSim cannot be accessed under parser for Win10
try:
modelica_map_json = parser_esim.get('eSim', 'MODELICA_MAP_JSON')
- except BaseException:
- print("Cannot access eSim in parser")
+ except BaseException as e:
+ print("Cannot access Modelica map file --- .esim folder")
+ print(str(e))
+
+ # Open file and read KiCad config path
+ try:
+ file = open('library/supportFiles/kicad_config_path.txt', 'r')
+ kicad_path = file.read().rstrip()
+ file.close()
+ except BaseException as e:
+ kicad_path = None
+ print(str(e))
try:
- project_explorer = json.load(open(dictPath))
+ project_explorer = json.load(open(dictPath["path"]))
except BaseException:
project_explorer = {}
process_obj = []
@@ -76,8 +97,8 @@ class Appconfig(QtGui.QWidget):
super(Appconfig, self).__init__()
# Application Details
self._APPLICATION = 'eSim'
- self._VERSION = 'v1.1'
- self._AUTHOR = 'Fahim'
+ self._VERSION = 'v2.0.0'
+ self._AUTHOR = 'Fahim, Rahul'
# Application geometry setting
self._app_xpos = 100
diff --git a/src/configuration/browser/UserManual.py b/src/configuration/browser/UserManual.py
deleted file mode 100644
index 3bcfbace..00000000
--- a/src/configuration/browser/UserManual.py
+++ /dev/null
@@ -1,20 +0,0 @@
-from PyQt4 import QtGui
-import webbrowser
-
-
-class UserManual(QtGui.QWidget):
- """
- This class creates Welcome page of eSim.
- """
-
- def __init__(self):
- QtGui.QWidget.__init__(self)
-
- self.vlayout = QtGui.QVBoxLayout()
-
- self.url = "../browser/pages/User-Manual/eSim.html"
- self.test = webbrowser.open(
- "../browser/pages/User-Manual/eSim.html", new=2)
-
- self.setLayout(self.vlayout)
- self.show()