diff options
Diffstat (limited to 'src/subcircuit/uploadSub.py')
-rw-r--r-- | src/subcircuit/uploadSub.py | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/src/subcircuit/uploadSub.py b/src/subcircuit/uploadSub.py index 00cc9df0..25a6e7d4 100644 --- a/src/subcircuit/uploadSub.py +++ b/src/subcircuit/uploadSub.py @@ -7,9 +7,9 @@ import shutil class UploadSub(QtGui.QWidget): """ - This class contain function for ulaoding subcircuits - in Subcircuit library present in src folder. - A folder is created in src/SubcircuitLibrary + This class contain function for uploading subcircuits + in SubcircuitLibrary present in src folder. + A folder is created in library/SubcircuitLibrary and desired file is moved to that folder. """ @@ -41,25 +41,32 @@ class UploadSub(QtGui.QWidget): if ext != '.sub': self.msg = QtGui.QErrorMessage(self) - self.msg.showMessage("Please ensure that filename ends with .sub") + self.msg.setModal(True) self.msg.setWindowTitle("Error Message") + self.msg.showMessage("Please ensure that filename ends with .sub") + self.msg.exec_() print("Invalid filename") return valid = self.obj_validation.validateSubcir(editfile, create_subcircuit) if not valid: self.msg = QtGui.QErrorMessage(self) - self.msg.showMessage( - "Content of file does not meet the required format.\ - Please ensure that file starts with **.subckt \ - " + create_subcircuit + "** and ends with **.ends \ - " + create_subcircuit + "**") + self.msg.setModal(True) self.msg.setWindowTitle("Error Message") + self.msg.showMessage( + "Content of file does not meet the required format. " + + "Please ensure that file starts with **.subckt " + + create_subcircuit + " ** and ends with **.ends " + + create_subcircuit + " **" + ) + self.msg.exec_() print("Invalid file format") return subcircuit_path = os.path.join( - os.path.abspath('..'), 'SubcircuitLibrary', create_subcircuit) + os.path.abspath('library'), + 'SubcircuitLibrary', create_subcircuit + ) reply = self.obj_validation.validateNewproj(subcircuit_path) @@ -79,15 +86,19 @@ class UploadSub(QtGui.QWidget): print("Project name already exists.") print("==========================") msg = QtGui.QErrorMessage(self) - msg.showMessage( - "The project already exist. Please select \ - the different name or delete existing project") + msg.setModal(True) msg.setWindowTitle("Error Message") + msg.showMessage( + "The project already exist. Please select " + "a different name or delete existing project") + msg.exec_() elif reply == "CHECKNAME": print("Name can not contain space between them") print("===========================") msg = QtGui.QErrorMessage(self) + msg.setModal(True) + msg.setWindowTitle("Error Message") msg.showMessage( 'The project name should not contain space between them') - msg.setWindowTitle("Error Message") + msg.exec_() |