From cb55e59de7ee4383c04edfae7c39ad9ae9552b36 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Fri, 14 Feb 2020 15:16:35 +0530 Subject: common code for Win and Linux, merged py2 changes --- src/subcircuit/convertSub.py | 14 +++++++------- src/subcircuit/newSub.py | 22 ++++++++++------------ src/subcircuit/uploadSub.py | 13 +++++++------ 3 files changed, 24 insertions(+), 25 deletions(-) (limited to 'src/subcircuit') diff --git a/src/subcircuit/convertSub.py b/src/subcircuit/convertSub.py index 7bdccfb2..1439f140 100644 --- a/src/subcircuit/convertSub.py +++ b/src/subcircuit/convertSub.py @@ -4,8 +4,7 @@ from configuration.Appconfig import Appconfig import os -# This class is called when User create new Project and contains \ -# functions to convert kicad to Ngspice. +# This class is called when user creates new Project class convertSub(QtGui.QWidget): """ Contains functions that checks project present for conversion and @@ -34,7 +33,6 @@ class convertSub(QtGui.QWidget): if self.obj_validation.validateKicad(self.projDir): # Checking if project has .cir file or not if self.obj_validation.validateCir(self.projDir): - # print "CIR file present" self.projName = os.path.basename(self.projDir) self.project = os.path.join(self.projDir, self.projName) @@ -44,12 +42,14 @@ class convertSub(QtGui.QWidget): else: self.msg = QtGui.QErrorMessage(None) self.msg.showMessage( - 'The subcircuit does not contain any Kicad netlist file' - + ' for conversion.') + 'The subcircuit does not contain any Kicad netlist file' + + ' for conversion.' + ) self.msg.setWindowTitle("Error Message") else: self.msg = QtGui.QErrorMessage(None) self.msg.showMessage( - 'Please select the subcircuit first. You can either create' - + ' new subcircuit or open existing subcircuit') + 'Please select the subcircuit first. You can either create ' + + 'new subcircuit or open existing subcircuit' + ) self.msg.setWindowTitle("Error Message") diff --git a/src/subcircuit/newSub.py b/src/subcircuit/newSub.py index bd88064a..90f60319 100644 --- a/src/subcircuit/newSub.py +++ b/src/subcircuit/newSub.py @@ -5,7 +5,7 @@ from projManagement import Worker import os -# This class is called when User create new Project. +# This class is called when User creates new Project. class NewSub(QtGui.QWidget): """ Contains functions to check : @@ -54,32 +54,30 @@ class NewSub(QtGui.QWidget): self.obj_workThread.start() self.close() except BaseException: - # print "Some Thing Went Wrong" self.msg = QtGui.QErrorMessage(self) self.msg.showMessage( - 'Unable to create subcircuit. Please make sure\ - you have write permission on ' + - self.schematic_path) + 'Unable to create subcircuit. Please make sure ' + + 'you have write permission on ' + self.schematic_path + ) self.msg.setWindowTitle("Error Message") self.obj_appconfig.current_subcircuit['SubcircuitName'] \ = self.schematic_path elif self.reply == "CHECKEXIST": - # print "Project already exist" self.msg = QtGui.QErrorMessage(self) self.msg.showMessage( - 'The subcircuit "' + - self.create_schematic + - '" already exist.Please select the different name or delete' - + 'existing subcircuit') + 'The subcircuit "' + self.create_schematic + + '" already exist.Please select the different name or delete' + + 'existing subcircuit' + ) self.msg.setWindowTitle("Error Message") elif self.reply == "CHECKNAME": - # print "Name is not proper" self.msg = QtGui.QErrorMessage(self) self.msg.showMessage( - 'The subcircuit name should not contain space between them') + 'The subcircuit name should not contain space between them' + ) self.msg.setWindowTitle("Error Message") elif self.reply == "NONE": diff --git a/src/subcircuit/uploadSub.py b/src/subcircuit/uploadSub.py index 00cc9df0..34ec8c33 100644 --- a/src/subcircuit/uploadSub.py +++ b/src/subcircuit/uploadSub.py @@ -50,10 +50,11 @@ class UploadSub(QtGui.QWidget): 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 + "**") + "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.setWindowTitle("Error Message") print("Invalid file format") return @@ -80,8 +81,8 @@ class UploadSub(QtGui.QWidget): print("==========================") msg = QtGui.QErrorMessage(self) msg.showMessage( - "The project already exist. Please select \ - the different name or delete existing project") + "The project already exist. Please select " + "a different name or delete existing project") msg.setWindowTitle("Error Message") elif reply == "CHECKNAME": -- cgit