diff options
Diffstat (limited to 'src/subcircuit')
-rw-r--r-- | src/subcircuit/newSub.py | 7 | ||||
-rw-r--r-- | src/subcircuit/openSub.py | 7 | ||||
-rw-r--r-- | src/subcircuit/uploadSub.py | 6 |
3 files changed, 17 insertions, 3 deletions
diff --git a/src/subcircuit/newSub.py b/src/subcircuit/newSub.py index 5e98d24a..9c9ebbd8 100644 --- a/src/subcircuit/newSub.py +++ b/src/subcircuit/newSub.py @@ -27,11 +27,16 @@ class NewSub(QtGui.QWidget): - Name can not be empty. - File name already exists. """ + + init_path = '../../' + if os.name == 'nt': + init_path = '' + self.create_schematic = subName # Checking if Workspace already exist or not self.schematic_path = ( os.path.join( - os.path.abspath('library'), + os.path.abspath(init_path + 'library'), 'SubcircuitLibrary', self.create_schematic)) diff --git a/src/subcircuit/openSub.py b/src/subcircuit/openSub.py index 6cb4fe3e..0e0906c0 100644 --- a/src/subcircuit/openSub.py +++ b/src/subcircuit/openSub.py @@ -16,9 +16,14 @@ class openSub(QtGui.QWidget): self.obj_appconfig = Appconfig() def body(self): + + init_path = '../../' + if os.name == 'nt': + init_path = '' + self.editfile = str( QtGui.QFileDialog.getExistingDirectory( - None, "Open File", "library/SubcircuitLibrary")) + None, "Open File", init_path + "library/SubcircuitLibrary")) if self.editfile: self.obj_Appconfig = Appconfig() self.obj_Appconfig.current_subcircuit['SubcircuitName'] \ diff --git a/src/subcircuit/uploadSub.py b/src/subcircuit/uploadSub.py index 25a6e7d4..c7b3951f 100644 --- a/src/subcircuit/uploadSub.py +++ b/src/subcircuit/uploadSub.py @@ -63,8 +63,12 @@ class UploadSub(QtGui.QWidget): print("Invalid file format") return + init_path = '../../' + if os.name == 'nt': + init_path = '' + subcircuit_path = os.path.join( - os.path.abspath('library'), + os.path.abspath(init_path + 'library'), 'SubcircuitLibrary', create_subcircuit ) |