summaryrefslogtreecommitdiff
path: root/src/modelEditor/ModelEditor.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/modelEditor/ModelEditor.py')
-rw-r--r--src/modelEditor/ModelEditor.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/modelEditor/ModelEditor.py b/src/modelEditor/ModelEditor.py
index 0b6990f3..e8fda482 100644
--- a/src/modelEditor/ModelEditor.py
+++ b/src/modelEditor/ModelEditor.py
@@ -30,7 +30,12 @@ class ModelEditorclass(QtGui.QWidget):
def __init__(self):
QtGui.QWidget.__init__(self)
- self.savepathtest = 'library/deviceModelLibrary'
+
+ self.init_path = '../../'
+ if os.name == 'nt':
+ self.init_path = ''
+
+ self.savepathtest = self.init_path + 'library/deviceModelLibrary'
self.obj_appconfig = Appconfig()
self.newflag = 0
self.layout = QtGui.QVBoxLayout()
@@ -252,7 +257,7 @@ class ModelEditorclass(QtGui.QWidget):
- Accordingly call `createtable(path)` to draw tables usingg QTable
- Check for the state of button before rendering
'''
- self.path = 'library/deviceModelLibrary/Templates'
+ self.path = self.init_path + 'library/deviceModelLibrary/Templates'
if self.diode.isChecked():
if filetype == 'Diode':
path = os.path.join(self.path, 'D.xml')
@@ -326,7 +331,7 @@ class ModelEditorclass(QtGui.QWidget):
QtGui.QFileDialog.getOpenFileName(
self,
"Open Library Directory",
- "library/deviceModelLibrary",
+ self.init_path + "library/deviceModelLibrary",
"*.lib"))
self.createtable(self.editfile)
except BaseException:
@@ -471,7 +476,7 @@ class ModelEditorclass(QtGui.QWidget):
ET.SubElement(param, tags).text = text
tree = ET.ElementTree(root)
defaultcwd = os.getcwd()
- self.savepath = 'library/deviceModelLibrary'
+ self.savepath = self.init_path + 'library/deviceModelLibrary'
if self.diode.isChecked():
savepath = os.path.join(self.savepath, 'Diode')
os.chdir(savepath)
@@ -695,7 +700,7 @@ class ModelEditorclass(QtGui.QWidget):
QtGui.QFileDialog.getOpenFileName(
self,
"Open Library Directory",
- "library/deviceModelLibrary",
+ self.init_path + "library/deviceModelLibrary",
"*.lib"))
libopen = open(self.libfile)
filedata = libopen.read().split()