summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrahulp132020-02-11 00:20:41 +0530
committerrahulp132020-02-11 00:20:41 +0530
commit4245ac1c7a4ef6a4e650ab666327210f2c812e3e (patch)
tree48a3b78ecf0a80f036a265a61242eff5a75ab061 /src
parent28bdf8d26cc422e27a52f33155555db877d07c6e (diff)
downloadnghdl-4245ac1c7a4ef6a4e650ab666327210f2c812e3e.tar.gz
nghdl-4245ac1c7a4ef6a4e650ab666327210f2c812e3e.tar.bz2
nghdl-4245ac1c7a4ef6a4e650ab666327210f2c812e3e.zip
pep8 compliant
Diffstat (limited to 'src')
-rw-r--r--src/createKicadLibrary.py14
-rw-r--r--src/model_generation.py10
-rwxr-xr-xsrc/ngspice_ghdl.py9
3 files changed, 17 insertions, 16 deletions
diff --git a/src/createKicadLibrary.py b/src/createKicadLibrary.py
index 144fb66..966c9d6 100644
--- a/src/createKicadLibrary.py
+++ b/src/createKicadLibrary.py
@@ -29,8 +29,8 @@ class AutoSchematic(QtGui.QWidget):
elif (xmlFound == self.xml_loc + '/Nghdl'):
print('Library already exists...')
ret = QtGui.QMessageBox.warning(
- self, "Warning", '''<b>Library files for this model already '''
- '''exist. Do you want to overwrite it?</b><br/>
+ self, "Warning", '''<b>Library files for this model ''' +
+ '''already exist. Do you want to overwrite it?</b><br/>
If yes press ok, else cancel it and ''' +
'''change the name of your vhdl file.''',
QtGui.QMessageBox.Ok, QtGui.QMessageBox.Cancel
@@ -251,10 +251,12 @@ class PortInfo:
if re.match(r'^\s*$', line):
pass
else:
- in_items = re.findall("IN",
- line, re.MULTILINE | re.IGNORECASE)
- out_items = re.findall("OUT",
- line, re.MULTILINE | re.IGNORECASE)
+ in_items = re.findall(
+ "IN", line, re.MULTILINE | re.IGNORECASE
+ )
+ out_items = re.findall(
+ "OUT", line, re.MULTILINE | re.IGNORECASE
+ )
if in_items:
input_list.append(line.split())
if out_items:
diff --git a/src/model_generation.py b/src/model_generation.py
index c295ba4..445143b 100644
--- a/src/model_generation.py
+++ b/src/model_generation.py
@@ -104,10 +104,12 @@ for line in data:
if re.match(r'^\s*$', line):
pass
else:
- in_items = re.findall("IN", line,
- re.MULTILINE | re.IGNORECASE)
- out_items = re.findall("OUT", line,
- re.MULTILINE | re.IGNORECASE)
+ in_items = re.findall(
+ "IN", line, re.MULTILINE | re.IGNORECASE
+ )
+ out_items = re.findall(
+ "OUT", line, re.MULTILINE | re.IGNORECASE
+ )
if in_items:
input_list.append(line.split())
else:
diff --git a/src/ngspice_ghdl.py b/src/ngspice_ghdl.py
index 0760ede..8fc5549 100755
--- a/src/ngspice_ghdl.py
+++ b/src/ngspice_ghdl.py
@@ -151,7 +151,7 @@ class Mainwindow(QtGui.QWidget):
print("Exiting application")
quit()
else:
- print("Creating model "+self.modelname+" directory")
+ print("Creating model " + self.modelname + " directory")
os.mkdir(self.modelname)
def addingModelInModpath(self):
@@ -159,15 +159,13 @@ class Mainwindow(QtGui.QWidget):
" in Modpath file " + self.digital_home)
# Adding name of model in the modpath file
# Check if the string is already in the file
- with open(self.digital_home + "/modpath.lst", 'a+') as f:
+ with open(self.digital_home + "/modpath.lst", 'r+') as f:
flag = 0
for line in f:
if line.strip() == self.modelname:
print("Found model "+self.modelname+" in the modpath.lst")
flag = 1
break
- else:
- pass
if flag == 0:
print("Adding model name "+self.modelname+" into modpath.lst")
@@ -229,8 +227,7 @@ class Mainwindow(QtGui.QWidget):
@QtCore.pyqtSlot()
def readAllStandard(self):
self.termedit.append(
- str(self.process.readAllStandardOutput().data(),
- encoding='utf-8')
+ str(self.process.readAllStandardOutput().data(), encoding='utf-8')
)
stderror = self.process.readAllStandardError()
if stderror.toUpper().contains("ERROR"):