diff options
-rw-r--r-- | src/createKicadLibrary.py | 14 | ||||
-rw-r--r-- | src/model_generation.py | 10 | ||||
-rwxr-xr-x | src/ngspice_ghdl.py | 9 |
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"): |