diff options
author | Sunil Shetye | 2019-06-11 16:00:13 +0530 |
---|---|---|
committer | GitHub | 2019-06-11 16:00:13 +0530 |
commit | 19e57ec09fc6ddb8e1462ebc118841207497109b (patch) | |
tree | 85cc00b16004b7c64dc76ebdf4cc84d6b1a84499 /src/ngspiceSimulation/NgspiceWidget.py | |
parent | 8b986efb1c9216e284f6cc27a8f44d09e5c5cc59 (diff) | |
parent | 9e92a335fc364d391e9b524c226602a1677c2518 (diff) | |
download | eSim-19e57ec09fc6ddb8e1462ebc118841207497109b.tar.gz eSim-19e57ec09fc6ddb8e1462ebc118841207497109b.tar.bz2 eSim-19e57ec09fc6ddb8e1462ebc118841207497109b.zip |
Merge pull request #85 from nilshah98/pep8
Made pep8 compliant
Diffstat (limited to 'src/ngspiceSimulation/NgspiceWidget.py')
-rw-r--r-- | src/ngspiceSimulation/NgspiceWidget.py | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 310cbe3c..52427681 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -1,37 +1,42 @@ -from PyQt4 import QtGui,QtCore +from PyQt4 import QtGui, QtCore from configuration.Appconfig import Appconfig import platform import os + class NgspiceWidget(QtGui.QWidget): """ This Class creates NgSpice Window """ - def __init__(self,command,projPath): + + def __init__(self, command, projPath): QtGui.QWidget.__init__(self) self.obj_appconfig = Appconfig() self.process = QtCore.QProcess(self) self.terminal = QtGui.QWidget(self) self.layout = QtGui.QVBoxLayout(self) self.layout.addWidget(self.terminal) - - print "Argument to ngspice command : ",command - + + print("Argument to ngspice 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.args = ['-hold','-e', self.command] + self.command = "cd " + projPath + ";ngspice " + command + # Creating argument for process + # self.args = ['-into', str(self.terminal.winId()),\ + # '-hold','-e', self.command] + self.args = ['-hold', '-e', self.command] self.process.start('xterm', self.args) self.obj_appconfig.process_obj.append(self.process) - self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']].append(self.process.pid()) - + ( + self.obj_appconfig.proc_dict + [self.obj_appconfig.current_project['ProjectName']].append( + self.process.pid()) + ) + elif platform.system() == 'Windows': - tempdir= os.getcwd() + tempdir = os.getcwd() projPath = self.obj_appconfig.current_project["ProjectName"] os.chdir(projPath) - self.command = "ngspice "+command + self.command = "ngspice " + command self.process.start(self.command) os.chdir(tempdir) - - |