summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFahim2015-06-29 15:48:51 +0530
committerFahim2015-06-29 15:48:51 +0530
commit100b26e42b6c7c8840fd8ef16db4ce0cef22aca7 (patch)
treece2c6b545d2a98f2f6461f377200c2a1fbbf3b7d
parent99b67e2cd043775c237a35e35866818fa9ba6d43 (diff)
parent1ef752288661105c78fda32f34fdf832d5e15563 (diff)
downloadnghdl-100b26e42b6c7c8840fd8ef16db4ce0cef22aca7.tar.gz
nghdl-100b26e42b6c7c8840fd8ef16db4ce0cef22aca7.tar.bz2
nghdl-100b26e42b6c7c8840fd8ef16db4ce0cef22aca7.zip
Merge pull request #9 from athulappadan/master
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()