diff options
Diffstat (limited to 'src/projManagement/Kicad.py')
-rw-r--r-- | src/projManagement/Kicad.py | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/src/projManagement/Kicad.py b/src/projManagement/Kicad.py index dd7fdf1a..aa4ba8eb 100644 --- a/src/projManagement/Kicad.py +++ b/src/projManagement/Kicad.py @@ -20,9 +20,10 @@ import os import Validation from configuration.Appconfig import Appconfig import Worker -from PyQt4 import QtGui +from PyQt4 import QtGui, QtCore import shutil from gevent.hub import sleep +import subprocess class Kicad: """ @@ -143,29 +144,23 @@ class Kicad: if self.obj_validation.validateKicad(self.projDir): self.projName = os.path.basename(self.projDir) self.project = os.path.join(self.projDir,self.projName) - print "Validated" #Creating ngspice command self.cmd = "xterm -e ngspice "+self.project+".cir.out" - self.obj_workThread = Worker.WorkerThread(self.cmd) - self.obj_workThread.start() - while 1: - if self.obj_workThread.isFinished(): - print "Finished" - sleep(1) - #Moving plot_data_i.txt and plot_data_v.txt to project directory - shutil.copy2("plot_data_i.txt", self.projDir) - shutil.copy2("plot_data_v.txt", self.projDir) - #Deleting this file from current directory - os.remove("plot_data_i.txt") - os.remove("plot_data_v.txt") - break - else: - pass - print "After While Loop" - + proc = subprocess.Popen(self.cmd.split()) + proc.communicate()[0] + + #Moving plot_data_i.txt and plot_data_v.txt to project directory + shutil.copy2("plot_data_i.txt", self.projDir) + shutil.copy2("plot_data_v.txt", self.projDir) + #Deleting this file from current directory + os.remove("plot_data_i.txt") + os.remove("plot_data_v.txt") + + return True + else: self.msg = QtGui.QErrorMessage(None) self.msg.showMessage('Please select the project first. You can either create new project or open existing project') self.msg.setWindowTitle("Error Message") -
\ No newline at end of file + return False
\ No newline at end of file |