From c13e7b0f873e4857f1ce7924c0a72609df3ddca2 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Fri, 24 Jul 2020 01:08:02 +0530 Subject: platform independent library and image paths, flake8 compliant --- src/subcircuit/newSub.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/subcircuit/newSub.py') 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)) -- cgit From 2eb6697de529a643127599070771a0278e9817b3 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Mon, 3 Aug 2020 12:03:41 +0530 Subject: ported GUI to PyQt5 --- src/subcircuit/newSub.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/subcircuit/newSub.py') diff --git a/src/subcircuit/newSub.py b/src/subcircuit/newSub.py index 9c9ebbd8..92dc1d29 100644 --- a/src/subcircuit/newSub.py +++ b/src/subcircuit/newSub.py @@ -1,4 +1,4 @@ -from PyQt4 import QtGui +from PyQt5 import QtWidgets from projManagement.Validation import Validation from configuration.Appconfig import Appconfig from projManagement import Worker @@ -6,7 +6,7 @@ import os # This class is called when User creates new Project. -class NewSub(QtGui.QWidget): +class NewSub(QtWidgets.QWidget): """ Contains functions to check : - Name of project should not be blank. @@ -59,7 +59,7 @@ class NewSub(QtGui.QWidget): self.obj_workThread.start() self.close() except BaseException: - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -72,7 +72,7 @@ class NewSub(QtGui.QWidget): = self.schematic_path elif self.reply == "CHECKEXIST": - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -83,7 +83,7 @@ class NewSub(QtGui.QWidget): self.msg.exec_() elif self.reply == "CHECKNAME": - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -92,7 +92,7 @@ class NewSub(QtGui.QWidget): self.msg.exec_() elif self.reply == "NONE": - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage('The subcircuit name cannot be empty') -- cgit