From 9f13750ffc4946177d7e22bed8b19e62ee76e502 Mon Sep 17 00:00:00 2001 From: komalsheth236 Date: Thu, 18 Jun 2015 16:11:06 +0530 Subject: Bug fixing for model editor and ngspicewidget for windows --- src/ngspiceSimulation/NgspiceWidget.py | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index b4202720..f2ad973f 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -1,6 +1,7 @@ from PyQt4 import QtGui,QtCore from configuration.Appconfig import Appconfig -import platform +import platform +import os class NgspiceWidget(QtGui.QWidget): """ @@ -13,15 +14,19 @@ class NgspiceWidget(QtGui.QWidget): self.terminal = QtGui.QWidget(self) self.layout = QtGui.QVBoxLayout(self) self.layout.addWidget(self.terminal) - print"command-------->", command - if platform.system() == 'Linux': - self.command = "cd "+projPath+";ngspice "+command - #Creating argument for process - self.args = ['-into', str(self.terminal.winId()),'-hold','-e', self.command] - self.process.start('xterm', self.args) - - elif platform.system() == 'Windows': - self.command = "ngspice "+command - self.process.start(self.command) - + print"command-------->", command + if platform.system() == 'Linux': + self.command = "cd "+projPath+";ngspice "+command + #Creating argument for process + self.args = ['-into', str(self.terminal.winId()),'-hold','-e', self.command] + self.process.start('xterm', self.args) + + elif platform.system() == 'Windows': + tempdir= os.getcwd() + projPath = self.obj_appconfig.current_project["ProjectName"] + os.chdir(projPath) + self.command = "ngspice "+command + self.process.start(self.command) + os.chdir(tempdir) + -- cgit