summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrahulp132020-02-14 17:21:28 +0530
committerrahulp132020-02-14 17:21:28 +0530
commitb173d88ac0059b67e60a042293b1e486c9620d8a (patch)
tree6d33534d5493ffda35afd1c7c26e50b5d2634367
parentafa8ebe1e94c854383edd0ab205d1ae3ca869260 (diff)
downloadeSim-b173d88ac0059b67e60a042293b1e486c9620d8a.tar.gz
eSim-b173d88ac0059b67e60a042293b1e486c9620d8a.tar.bz2
eSim-b173d88ac0059b67e60a042293b1e486c9620d8a.zip
pep8 compliant
-rw-r--r--src/frontEnd/Application.py92
-rw-r--r--src/frontEnd/DockArea.py4
-rw-r--r--src/kicadtoNgspice/Analysis.py2
-rw-r--r--src/kicadtoNgspice/Convert.py2
-rw-r--r--src/kicadtoNgspice/Processing.py6
-rw-r--r--src/kicadtoNgspice/Source.py2
-rw-r--r--src/ngspiceSimulation/pythonPlotting.py8
-rw-r--r--src/projManagement/Kicad.py2
-rw-r--r--src/projManagement/Validation.py2
-rw-r--r--src/projManagement/Worker.py4
10 files changed, 69 insertions, 55 deletions
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py
index 6cb25e80..1ea43224 100644
--- a/src/frontEnd/Application.py
+++ b/src/frontEnd/Application.py
@@ -12,7 +12,7 @@
# AUTHOR: Fahim Khan, fahim.elex@gmail.com
# MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in
# ORGANIZATION: eSim team at FOSSEE, IIT Bombay.
-# CREATED: Tuesday 24 February 2015
+# CREATED: Tuesday 24 February 2015
# REVISION: Friday 14 February 2020
# =========================================================================
@@ -45,9 +45,9 @@ class Application(QtGui.QMainWindow):
# Calling __init__ of super class
QtGui.QMainWindow.__init__(self, *args)
- #Flag for mode of operation. Default is set to offline mode.
+ # Flag for mode of operation. Default is set to offline mode.
self.online_flag = False
-
+
# Creating require Object
self.obj_workspace = Workspace.Workspace()
self.obj_Mainview = MainView()
@@ -345,44 +345,45 @@ class Application(QtGui.QMainWindow):
# -----------------------------------------------------
# fp-lib-table is not there than copy from supportFiles/
if not os.path.exists(
- self.obj_appconfig.kicad_path + "/fp-lib-table"):
- shutil.copy('../supportFiles/fp-lib-table' ,
- self.obj_appconfig.kicad_path + "/")
+ self.obj_appconfig.kicad_path +
+ "/fp-lib-table"
+ ):
+ shutil.copy('../supportFiles/fp-lib-table',
+ self.obj_appconfig.kicad_path + "/")
# -----------------------------------------------------
"""checking online and offline both file's are avaliable.
if yes than remove offline file."""
if os.path.exists(self.obj_appconfig.kicad_path +
- "/fp-lib-table-offline") and os.path.exists(
- self.obj_appconfig.kicad_path +
- "/fp-lib-table-online"):
- os.remove(self.obj_appconfig.kicad_path +
- "/fp-lib-table-offline")
+ "/fp-lib-table-offline") and os.path.exists(
+ self.obj_appconfig.kicad_path + "/fp-lib-table-online"):
+ os.remove(self.obj_appconfig.kicad_path +
+ "/fp-lib-table-offline")
# -----------------------------------------------------
# This ladder is used for checking which file is present.
if os.path.exists(self.obj_appconfig.kicad_path +
- "/fp-lib-table-offline"):
+ "/fp-lib-table-offline"):
self.switchmode = QtGui.QAction(
QtGui.QIcon('../../images/online.png'),
- '<b>Go Offline</b>',self)
+ '<b>Go Offline</b>', self)
self.online_flag = True
elif os.path.exists(self.obj_appconfig.kicad_path +
- "/fp-lib-table-online"):
+ "/fp-lib-table-online"):
self.switchmode = QtGui.QAction(
QtGui.QIcon('../../images/offline.png'),
- '<b>Go Online</b>',self)
+ '<b>Go Online</b>', self)
self.online_flag = False
else:
# if online and offline is not avaliable
- shutil.copy('../supportFiles/fp-lib-table-online' ,
- self.obj_appconfig.kicad_path + "/")
+ shutil.copy('../supportFiles/fp-lib-table-online',
+ self.obj_appconfig.kicad_path + "/")
if os.path.exists(self.obj_appconfig.kicad_path +
- "/fp-lib-table-online"):
+ "/fp-lib-table-online"):
self.switchmode = QtGui.QAction(
QtGui.QIcon('../../images/offline.png'),
- '<b>Go Online</b>',self)
+ '<b>Go Online</b>', self)
self.online_flag = False
- #----------------------------------------------------
+ # ----------------------------------------------------
else:
# if path is not found
self.switchmode = QtGui.QAction(QtGui.QIcon(
@@ -393,11 +394,11 @@ class Application(QtGui.QMainWindow):
def change_mode(self):
"""
This function is used for changing mode of operation for KiCad. \
- There are three modes of operation :
- - online
+ There are three modes of operation :
+ - online
- offline
- disable
-
+
It will check whether kicad config path is present or not.
- If path is available and none of the KiCad tools \
(associated with eSim) are open, then depending on \
@@ -417,37 +418,48 @@ class Application(QtGui.QMainWindow):
if self.online_flag:
os.rename(
self.obj_appconfig.kicad_path + "/fp-lib-table",
- self.obj_appconfig.kicad_path + "/fp-lib-table-online"
+ self.obj_appconfig.kicad_path +
+ "/fp-lib-table-online"
)
os.rename(
- self.obj_appconfig.kicad_path + "/fp-lib-table-offline",
+ self.obj_appconfig.kicad_path +
+ "/fp-lib-table-offline",
self.obj_appconfig.kicad_path + "/fp-lib-table"
)
- self.switchmode.setIcon(QtGui.QIcon('../../images/offline.png'))
+ self.switchmode.setIcon(
+ QtGui.QIcon('../../images/offline.png')
+ )
self.switchmode.setText('<b>Go Online</b>')
self.online_flag = False
else:
os.rename(
self.obj_appconfig.kicad_path + "/fp-lib-table",
- self.obj_appconfig.kicad_path + "/fp-lib-table-offline")
+ self.obj_appconfig.kicad_path +
+ "/fp-lib-table-offline"
+ )
os.rename(
- self.obj_appconfig.kicad_path + "/fp-lib-table-online",
- self.obj_appconfig.kicad_path + "/fp-lib-table")
- self.switchmode.setIcon(QtGui.QIcon('../../images/online.png'))
+ self.obj_appconfig.kicad_path +
+ "/fp-lib-table-online",
+ self.obj_appconfig.kicad_path + "/fp-lib-table"
+ )
+ self.switchmode.setIcon(
+ QtGui.QIcon('../../images/online.png')
+ )
self.switchmode.setText('<b>Go Offline</b>')
self.online_flag = True
else:
self.msg = QtGui.QErrorMessage()
- self.msg.showMessage('Please save and close all the Kicad'
- 'Windows first, and then change the online-offline mode')
+ self.msg.showMessage(
+ 'Please save and close all the Kicad ' +
+ 'windows first, then change the online-offline mode')
self.msg.setWindowTitle("Error Message")
- except:
+ except BaseException:
self.validate_mode()
else:
- self.info_msg = QtGui.QMessageBox.critical(self,
- 'Message',
- "Please make sure kicad_folder_file is " +
- "present in supportFiles folder.")
+ self.info_msg = QtGui.QMessageBox.critical(
+ self, 'Message', "Please make sure kicad_folder_file is " +
+ "present in supportFiles folder."
+ )
def help_project(self):
"""
@@ -542,9 +554,9 @@ class Application(QtGui.QMainWindow):
else:
self.msg = QtGui.QErrorMessage(None)
self.msg.showMessage('Error while opening NGHDL. ' +
- 'Please make sure it is installed')
+ 'Please make sure it is installed')
self.obj_appconfig.print_error('Error while opening NGHDL. ' +
- 'Please make sure it is installed')
+ 'Please make sure it is installed')
self.msg.setWindowTitle('NGHDL Error')
def open_modelEditor(self):
@@ -610,7 +622,7 @@ class Application(QtGui.QMainWindow):
self.msg.setWindowTitle("Missing OpenModelica")
self.obj_appconfig.print_info(self.msgContent)
self.msg.exec_()
-
+
except Exception as e:
self.msg = QtGui.QErrorMessage()
self.msg.showMessage(
diff --git a/src/frontEnd/DockArea.py b/src/frontEnd/DockArea.py
index 9824a307..b8ebfac4 100644
--- a/src/frontEnd/DockArea.py
+++ b/src/frontEnd/DockArea.py
@@ -56,7 +56,7 @@ class DockArea(QtGui.QMainWindow):
def createTestEditor(self):
"""This function create widget for Library Editor"""
global count
-
+
self.testWidget = QtGui.QWidget()
self.testArea = QtGui.QTextEdit()
self.testLayout = QtGui.QVBoxLayout()
@@ -148,7 +148,7 @@ class DockArea(QtGui.QMainWindow):
dock['NgSpice-' + str(count)].setVisible(True)
dock['NgSpice-' + str(count)].setFocus()
dock['NgSpice-' + str(count)].raise_()
-
+
temp = self.obj_appconfig.current_project['ProjectName']
if temp:
self.obj_appconfig.dock_dict[temp].append(
diff --git a/src/kicadtoNgspice/Analysis.py b/src/kicadtoNgspice/Analysis.py
index e5c05ebe..9e91cca9 100644
--- a/src/kicadtoNgspice/Analysis.py
+++ b/src/kicadtoNgspice/Analysis.py
@@ -837,7 +837,7 @@ class Analysis(QtGui.QWidget):
print("Transient Analysis JSON Parse Error")
return self.trbox
-
+
'''
- Below 3 functions handle event for the combo box in transient group
'''
diff --git a/src/kicadtoNgspice/Convert.py b/src/kicadtoNgspice/Convert.py
index 99f8768a..ae26f3b8 100644
--- a/src/kicadtoNgspice/Convert.py
+++ b/src/kicadtoNgspice/Convert.py
@@ -638,5 +638,5 @@ class Convert:
for child in libtree.iter():
if child.tag == 'ref_model':
retVal = child.text
-
+
return retVal
diff --git a/src/kicadtoNgspice/Processing.py b/src/kicadtoNgspice/Processing.py
index 1e58daac..427f0823 100644
--- a/src/kicadtoNgspice/Processing.py
+++ b/src/kicadtoNgspice/Processing.py
@@ -91,7 +91,7 @@ class PrcocessNetlist:
print("=============================================================")
print("NETLIST", netlist)
print("INFOLINE", infoline)
- print("=============================================================")"""
+ print("===========================================================")"""
return netlist, infoline
def separateNetlistInfo(self, netlist):
@@ -116,7 +116,7 @@ class PrcocessNetlist:
print("=============================================================")
print("OPTIONINFO", optionInfo)
print("SCHEMATICINFO", schematicInfo)
- print("=============================================================")"""
+ print("===========================================================")"""
return optionInfo, schematicInfo
def insertSpecialSourceParam(self, schematicInfo, sourcelist):
@@ -220,7 +220,7 @@ class PrcocessNetlist:
print("=============================================================")
print("SCHEMATICINFO", schematicInfo)
print("SOURCELIST", sourcelist)
- print("=============================================================")"""
+ print("===========================================================")"""
return schematicInfo, sourcelist
def convertICintoBasicBlocks(
diff --git a/src/kicadtoNgspice/Source.py b/src/kicadtoNgspice/Source.py
index 6c5ae637..e76118d4 100644
--- a/src/kicadtoNgspice/Source.py
+++ b/src/kicadtoNgspice/Source.py
@@ -47,7 +47,7 @@ class Source(QtGui.QWidget):
"""print("============================================================")
print("SOURCE LIST TRACK", sourcelisttrack)
print("SOURCE LIST", sourcelist)
- print("============================================================")"""
+ print("===========================================================")"""
kicadFile = self.clarg1
(projpath, filename) = os.path.split(kicadFile)
project_name = os.path.basename(projpath)
diff --git a/src/ngspiceSimulation/pythonPlotting.py b/src/ngspiceSimulation/pythonPlotting.py
index e19b49de..4a32f658 100644
--- a/src/ngspiceSimulation/pythonPlotting.py
+++ b/src/ngspiceSimulation/pythonPlotting.py
@@ -283,11 +283,13 @@ class plotWindow(QtGui.QMainWindow):
if a[i] == len(self.obj_dataext.NBList):
QtGui.QMessageBox.about(
- self, "Warning!!", "One of the operands doesn't belong "
- "to the above list!!")
+ self, "Warning!!", "One of the operands doesn't belong " +
+ "to the above list!!"
+ )
self.warnning.setText(
"<font color='red'>To Err Is Human!<br>One of the " +
- "operands doesn't belong to the above list!!</font>")
+ "operands doesn't belong to the above list!!</font>"
+ )
if self.parts[1] == 'vs':
if len(self.parts) > 3:
diff --git a/src/projManagement/Kicad.py b/src/projManagement/Kicad.py
index 02695ef4..c522af56 100644
--- a/src/projManagement/Kicad.py
+++ b/src/projManagement/Kicad.py
@@ -50,7 +50,7 @@ class Kicad:
@return
True => If the project's schematic is not open
- False => If the project's schematic is open
+ False => If the project's schematic is open
"""
if self.obj_workThread:
procList = self.obj_workThread.get_proc_threads()[:]
diff --git a/src/projManagement/Validation.py b/src/projManagement/Validation.py
index b2d568e4..23a66416 100644
--- a/src/projManagement/Validation.py
+++ b/src/projManagement/Validation.py
@@ -38,7 +38,7 @@ class Validation:
projName.proj file exists or not
@params
- :projDir => contains the path of the project folder selected to open
+ :projDir => contains the path of the project selected to open
@return
True => If the folder contains the projName.proj file
diff --git a/src/projManagement/Worker.py b/src/projManagement/Worker.py
index e523b533..8ced35a7 100644
--- a/src/projManagement/Worker.py
+++ b/src/projManagement/Worker.py
@@ -60,10 +60,10 @@ class WorkerThread(QtCore.QThread):
and is called to check if project's schematic is open or not.
@params
-
+
@return
:self.my_workers
- """
+ """
return self.my_workers
def run(self):