diff options
author | Pranav P | 2023-06-01 12:42:10 +0530 |
---|---|---|
committer | Pranav P | 2023-06-01 12:45:38 +0530 |
commit | 9a01a2606665c521c1ee10fa94394127d5decbf3 (patch) | |
tree | bb77caa6f1b748470c088e348125d4f80a02157e /src/ngspiceSimulation | |
parent | fd3852efb732b6434a5327a056135f3444b93ba3 (diff) | |
download | eSim-9a01a2606665c521c1ee10fa94394127d5decbf3.tar.gz eSim-9a01a2606665c521c1ee10fa94394127d5decbf3.tar.bz2 eSim-9a01a2606665c521c1ee10fa94394127d5decbf3.zip |
Changed style in accordance with flake8
Diffstat (limited to 'src/ngspiceSimulation')
-rw-r--r-- | src/ngspiceSimulation/NgspiceWidget.py | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index b19936de..1aa8e15d 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -1,6 +1,6 @@ from PyQt5 import QtWidgets, QtCore from configuration.Appconfig import Appconfig -from configparser import ConfigParser +# from configparser import ConfigParser from frontEnd import TerminalUi import os import time @@ -43,12 +43,12 @@ class NgspiceWidget(QtWidgets.QWidget): # os.chdir(tempdir) # else: # For Linux OS - # Creating argument for process self.currTime = time.time() self.process.setWorkingDirectory(self.projDir) self.process.start('ngspice', self.args) - self.process.readyReadStandardOutput.connect(lambda: self.readyReadAll()) + self.process.readyReadStandardOutput.connect( + lambda: self.readyReadAll()) self.process.finished.connect(self.finishSimulation) self.obj_appconfig.process_obj.append(self.process) print(self.obj_appconfig.proc_dict) @@ -63,17 +63,20 @@ class NgspiceWidget(QtWidgets.QWidget): print(self.gawCommand) def finishSimulation(self, exitCode, exitStatus): - """This function is intended to run when the ngspice simulation finishes. - It singals to the function that generates the plots and also writes in the - appropriate status of the simulation (Whether it was a success or not). + """This function is intended to run when the ngspice + simulation finishes. It singals to the function that generates + the plots and also writes in the appropriate status of the + simulation (Whether it was a success or not). - :param exitCode: The exit code signal of the qprocess that runs ngspice + :param exitCode: The exit code signal of the qprocess + that runs ngspice :type exitCode: int - :param exitStatus: The exit status signal of the qprocess that runs ngspice + :param exitStatus: The exit status signal of the + qprocess that runs ngspice :type exitStatus: class:`QtCore.QProcess.ExitStatus` """ - #To stop progressbar from running after simulation is completed +# To stop progressbar from running after simulation is completed self.terminalUi.progressBar.setMaximum(100) self.terminalUi.progressBar.setProperty("value", 100) @@ -87,22 +90,25 @@ class NgspiceWidget(QtWidgets.QWidget): self.terminalUi.simulationConsole.verticalScrollBar().maximum() ) - #To set the current time stamp of the generated file so as for re-simulation +# To set the current time stamp of the generated +# file so as for re-simulation self.currTime = time.time() @QtCore.pyqtSlot() def readyReadAll(self): - """Outputs the ngspice process standard output and standard error to :class:`TerminalUi.TerminalUi` console + """Outputs the ngspice process standard output and standard error + to :class:`TerminalUi.TerminalUi` console """ self.terminalUi.simulationConsole.insertPlainText( str(self.process.readAllStandardOutput().data(), encoding='utf-8') ) - stderror = str(self.process.readAllStandardError().data(), encoding='utf-8') - #For suppressing the PrinterOnly error that batch mode throws - stderror = '\n'.join([line for line in stderror.split('\n') + stderror = str(self.process.readAllStandardError().data(), + encoding='utf-8') +# For suppressing the PrinterOnly error that batch mode throws + stderror = '\n'.join([line for line in stderror.split('\n') if ('PrinterOnly' not in line and 'viewport for graphics' not in line)]) self.terminalUi.simulationConsole.insertPlainText( stderror - )
\ No newline at end of file + ) |