From 1970530f0818577ef6fb1b2018d76829195c87e9 Mon Sep 17 00:00:00 2001 From: nilshah98 Date: Fri, 7 Jun 2019 18:06:05 +0530 Subject: python calls updated to python3 calls --- src/frontEnd/Application.py | 46 ++++++++++++++++++++++++++++++ src/ngspicetoModelica/ModelicaUI.py | 2 +- src/ngspicetoModelica/NgspicetoModelica.py | 2 +- src/projManagement/Kicad.py | 2 +- 4 files changed, 49 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index b440902f..c2790a80 100755 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -408,6 +408,52 @@ class Application(QtGui.QMainWindow): self.projDir, self.projName + ".cir.out") self.modelicaNetlist = os.path.join( self.projDir, self.projName + ".mo") + + """ + try: + # Creating a command for Ngspice to Modelica converter + self.cmd1 = " + python3 ../ngspicetoModelica/NgspicetoModelica.py "\ + +self.ngspiceNetlist + self.obj_workThread1 = Worker.WorkerThread(self.cmd1) + self.obj_workThread1.start() + + + if self.obj_validation.validateTool("OMEdit"): + # Creating command to run OMEdit + self.cmd2 = "OMEdit "+self.modelicaNetlist + self.obj_workThread2 = Worker.WorkerThread(self.cmd2) + self.obj_workThread2.start() + else: + self.msg = QtGui.QMessageBox() + self.msgContent = "There was an error while + opening OMEdit.
\ + Please make sure OpenModelica is installed in your\ + system.
\ + To install it on Linux : Go to\ + OpenModelica Linux and \ + install nigthly build release.
\ + To install it on Windows : Go to\ + OpenModelica Windows\ + and install latest version.
" + self.msg.setTextFormat(QtCore.Qt.RichText) + self.msg.setText(self.msgContent) + self.msg.setWindowTitle("Missing OpenModelica") + self.obj_appconfig.print_info(self.msgContent) + self.msg.exec_() + + except Exception as e: + self.msg = QtGui.QErrorMessage() + self.msg.showMessage( + 'Unable to convert NgSpice netlist to\ + Modelica netlist :'+str(e)) + self.msg.setWindowTitle( + "Ngspice to Modelica conversion error") + self.obj_appconfig.print_error(str(e)) + """ + self.obj_Mainview.obj_dockarea.modelicaEditor(self.projDir) else: diff --git a/src/ngspicetoModelica/ModelicaUI.py b/src/ngspicetoModelica/ModelicaUI.py index daef6e76..1d860fb7 100644 --- a/src/ngspicetoModelica/ModelicaUI.py +++ b/src/ngspicetoModelica/ModelicaUI.py @@ -52,7 +52,7 @@ class OpenModelicaEditor(QtGui.QWidget): def callConverter(self): try: - self.cmd1 = "python ../ngspicetoModelica/NgspicetoModelica.py " + \ + self.cmd1 = "python3 ../ngspicetoModelica/NgspicetoModelica.py " + \ self.ngspiceNetlist + ' ' + self.map_json # self.obj_workThread1 = Worker.WorkerThread(self.cmd1) # self.obj_workThread1.start() diff --git a/src/ngspicetoModelica/NgspicetoModelica.py b/src/ngspicetoModelica/NgspicetoModelica.py index dfeafb53..007c5a74 100644 --- a/src/ngspicetoModelica/NgspicetoModelica.py +++ b/src/ngspicetoModelica/NgspicetoModelica.py @@ -1268,7 +1268,7 @@ def main(args): map_json = sys.argv[2] else: print("USAGE:") - print("python NgspicetoModelica.py ") + print("python3 NgspicetoModelica.py ") sys.exit() dir_name = os.path.dirname(os.path.realpath(filename)) diff --git a/src/projManagement/Kicad.py b/src/projManagement/Kicad.py index d8c413c3..8b20112e 100644 --- a/src/projManagement/Kicad.py +++ b/src/projManagement/Kicad.py @@ -180,7 +180,7 @@ class Kicad: # Creating a command to run """ - self.cmd = ("python ../kicadtoNgspice/KicadtoNgspice.py " + self.cmd = ("python3 ../kicadtoNgspice/KicadtoNgspice.py " + "self.project+".cir ") self.obj_workThread = Worker.WorkerThread(self.cmd) self.obj_workThread.start() -- cgit