From 30c607ef581345958f0f9bdb5dd5603a1dd774c8 Mon Sep 17 00:00:00 2001 From: nilshah98 Date: Sun, 31 Mar 2019 04:28:27 +0530 Subject: port to python3 --- src/ngspiceSimulation/NgspiceWidget.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 310cbe3c..b5645808 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -14,9 +14,9 @@ class NgspiceWidget(QtGui.QWidget): 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 @@ -24,8 +24,8 @@ class NgspiceWidget(QtGui.QWidget): 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() projPath = self.obj_appconfig.current_project["ProjectName"] @@ -33,5 +33,3 @@ class NgspiceWidget(QtGui.QWidget): self.command = "ngspice "+command self.process.start(self.command) os.chdir(tempdir) - - -- cgit From 28d8fd378bf717e8daba8a564708856769f24b98 Mon Sep 17 00:00:00 2001 From: maddy-2 Date: Mon, 27 May 2019 12:32:49 +0530 Subject: initialise pep8 compliance, using autopep8 --- src/ngspiceSimulation/NgspiceWidget.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index b5645808..1d19199e 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -1,13 +1,15 @@ -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) @@ -15,21 +17,22 @@ class NgspiceWidget(QtGui.QWidget): 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.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.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) -- cgit From 60f301882da9aa06faba7c3c2b1b9fe2b9f39f17 Mon Sep 17 00:00:00 2001 From: nilshah98 Date: Tue, 28 May 2019 12:24:11 +0530 Subject: ngspiceSimulation made pep8 compliant --- src/ngspiceSimulation/NgspiceWidget.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 1d19199e..52427681 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -22,12 +22,16 @@ class NgspiceWidget(QtGui.QWidget): 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 = ['-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() -- cgit