summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorathulappadan2015-06-29 15:45:25 +0530
committerathulappadan2015-06-29 15:45:25 +0530
commit1ef752288661105c78fda32f34fdf832d5e15563 (patch)
treece2c6b545d2a98f2f6461f377200c2a1fbbf3b7d
parent99b67e2cd043775c237a35e35866818fa9ba6d43 (diff)
downloadnghdl-1ef752288661105c78fda32f34fdf832d5e15563.tar.gz
nghdl-1ef752288661105c78fda32f34fdf832d5e15563.tar.bz2
nghdl-1ef752288661105c78fda32f34fdf832d5e15563.zip
bug in remove method fixed
-rwxr-xr-xsrc/ngspice_ghdl.py46
1 files changed, 28 insertions, 18 deletions
diff --git a/src/ngspice_ghdl.py b/src/ngspice_ghdl.py
index 8f79f67..ce381d4 100755
--- a/src/ngspice_ghdl.py
+++ b/src/ngspice_ghdl.py
@@ -72,18 +72,24 @@ class Mainwindow(QtGui.QWidget):
self.filename = QtGui.QFileDialog.getOpenFileName(self, 'Open File', '.')
print "Path file :", self.filename
self.ledit.setText(self.filename)
+ self.file_list[:] = []
+ self.sedit.clear()
def addFiles(self):
print "Add Files button clicked"
title = self.addbtn.text()
for file in QtGui.QFileDialog.getOpenFileNames(self, title):
- print "Supporting file :", file
- self.sedit.append(str(file))
- self.file_list.append(file)
+ print "Supporting file :", file
+ self.sedit.append(str(file))
+ self.file_list.append(file)
def removeFiles(self):
+ if len(self.file_list) > 0:
self.fileRemover = FileRemover(self)
+ else:
+ QtGui.QMessageBox.about(self, 'Message', '''<b>Error</b><br/><br/>Select supporting files''')
+
#check extensions of all supporting files
@@ -221,20 +227,25 @@ class Mainwindow(QtGui.QWidget):
def uploadModle(self):
print "Upload button clicked"
- self.file_extension = os.path.splitext(str(self.filename))[1]
- print "File extension",self.file_extension
- print "Parser Content:",self.parser.get('NGSPICE', 'NGSPICE_HOME')
- self.cur_dir = os.getcwd()
- print "My Current Working Directory",self.cur_dir
- self.checkSupportFiles()
- if self.file_extension == ".vhdl":
- self.createModelDirectory()
- self.addingModelInModpath()
- self.createModelFiles()
- self.runMake()
- self.runMakeInstall()
- else:
- QtGui.QMessageBox.about(self,'Message','''<b>Important Message.</b><br/><br/>This accepts only <b>.vhdl</b> file ''')
+ #self.file_list[:] = []
+ try:
+ self.file_extension = os.path.splitext(str(self.filename))[1]
+ print "File extension",self.file_extension
+ print "Parser Content:",self.parser.get('NGSPICE', 'NGSPICE_HOME')
+ self.cur_dir = os.getcwd()
+ print "My Current Working Directory",self.cur_dir
+ self.checkSupportFiles()
+ if self.file_extension == ".vhdl":
+ self.createModelDirectory()
+ self.addingModelInModpath()
+ self.createModelFiles()
+ self.runMake()
+ self.runMakeInstall()
+ else:
+ QtGui.QMessageBox.about(self,'Message','''<b>Important Message.</b><br/><br/>This accepts only <b>.vhdl</b> file ''')
+
+ except:
+ QtGui.QMessageBox.about(self,'Message','''<b>Error.</b><br/><br/>Select a .vhdl file''')
class FileRemover(QtGui.QWidget):
@@ -305,7 +316,6 @@ class FileRemover(QtGui.QWidget):
self.sedit.append(path)
self.marked_list[:] = []
- self.files[:] = []
self.close()