From cb55e59de7ee4383c04edfae7c39ad9ae9552b36 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Fri, 14 Feb 2020 15:16:35 +0530 Subject: common code for Win and Linux, merged py2 changes --- src/ngspicetoModelica/ModelicaUI.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/ngspicetoModelica') diff --git a/src/ngspicetoModelica/ModelicaUI.py b/src/ngspicetoModelica/ModelicaUI.py index eca03534..d5daf9ad 100644 --- a/src/ngspicetoModelica/ModelicaUI.py +++ b/src/ngspicetoModelica/ModelicaUI.py @@ -44,13 +44,11 @@ class OpenModelicaEditor(QtGui.QWidget): self.show() def browseFile(self): - self.ngspiceNetlist = QtGui.QFileDialog.getOpenFileName( self, 'Open Ngspice file', BROWSE_LOCATION) self.FileEdit.setText(self.ngspiceNetlist) def callConverter(self): - try: self.cmd1 = ( "python3 ../ngspicetoModelica/NgspicetoModelica.py " + @@ -67,17 +65,18 @@ class OpenModelicaEditor(QtGui.QWidget): stderr=STDOUT, close_fds=True) error_code = convert_process.stdout.read() + if not error_code: self.msg = QtGui.QMessageBox() self.msg.setText( "Ngspice netlist successfully converted to OpenModelica" + - "netlist") + "netlist" + ) self.obj_appconfig.print_info( "Ngspice netlist successfully converted to OpenModelica" + "netlist" ) self.msg.exec_() - else: self.err_msg = QtGui.QErrorMessage() self.err_msg.showMessage( -- cgit