diff options
Diffstat (limited to 'src/projManagement')
-rw-r--r-- | src/projManagement/Kicad.py | 8 | ||||
-rw-r--r-- | src/projManagement/Validation.py | 12 | ||||
-rw-r--r-- | src/projManagement/Worker.py | 26 | ||||
-rw-r--r-- | src/projManagement/Worker.py.bak | 46 | ||||
-rw-r--r-- | src/projManagement/newProject.py | 2 | ||||
-rw-r--r-- | src/projManagement/openProject.py | 4 |
6 files changed, 70 insertions, 28 deletions
diff --git a/src/projManagement/Kicad.py b/src/projManagement/Kicad.py index ec3c69da..d4ee9b42 100644 --- a/src/projManagement/Kicad.py +++ b/src/projManagement/Kicad.py @@ -17,9 +17,9 @@ #=============================================================================== import os -import Validation +from . import Validation from configuration.Appconfig import Appconfig -import Worker +from . import Worker from PyQt4 import QtGui class Kicad: @@ -35,7 +35,7 @@ class Kicad: """ This function create command to open Kicad schematic """ - print "Function : Open Kicad Schematic" + print("Function : Open Kicad Schematic") self.projDir = self.obj_appconfig.current_project["ProjectName"] try: self.obj_appconfig.print_info('Kicad Schematic is called for project ' + self.projDir) @@ -123,7 +123,7 @@ class Kicad: """ This function create command to call kicad to Ngspice converter. """ - print "Function: Open Kicad to Ngspice Converter" + print("Function: Open Kicad to Ngspice Converter") self.projDir = self.obj_appconfig.current_project["ProjectName"] try: diff --git a/src/projManagement/Validation.py b/src/projManagement/Validation.py index a582cab5..b401e5e1 100644 --- a/src/projManagement/Validation.py +++ b/src/projManagement/Validation.py @@ -34,7 +34,7 @@ class Validation: """ This function validate Open Project Information. """ - print "Function: Validating Open Project Information" + print("Function: Validating Open Project Information") projName = os.path.basename(str(projDir)) lookProj = os.path.join(str(projDir),projName+".proj") #Check existence of project @@ -49,7 +49,7 @@ class Validation: """ This Project Validate New Project Information """ - print "Function: Validating New Project Information" + print("Function: Validating New Project Information") #Checking existence of project with same name if os.path.exists(projDir): @@ -65,7 +65,7 @@ class Validation: """ This function validate if Kicad components are present """ - print "FUnction : Validating for Kicad components" + print("FUnction : Validating for Kicad components") if projDir == None: return False else: @@ -104,9 +104,9 @@ class Validation: #The number of ports is specified in this line #eg. '.subckt ua741 6 7 3' has 3 ports (6, 7 and 3). numPorts = len(words) - 2 - print "Looksub : ",lookSub - print "Given Number of ports : ",givenNum - print "Actual Number of ports :",numPorts + print("Looksub : ",lookSub) + print("Given Number of ports : ",givenNum) + print("Actual Number of ports :",numPorts) if numPorts != givenNum: return "PORT" else: diff --git a/src/projManagement/Worker.py b/src/projManagement/Worker.py index 6befca65..f0fe7234 100644 --- a/src/projManagement/Worker.py +++ b/src/projManagement/Worker.py @@ -1,18 +1,18 @@ #=============================================================================== # # FILE: WorkerThread.py -# -# USAGE: --- -# +# +# USAGE: --- +# # DESCRIPTION: This class open all third party application using QT Thread -# +# # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: Fahim Khan, fahim.elex@gmail.com # ORGANIZATION: eSim team at FOSSEE, IIT Bombay. -# CREATED: Tuesday 24 Feb 2015 +# CREATED: Tuesday 24 Feb 2015 # REVISION: --- #=============================================================================== from PyQt4 import QtCore @@ -26,21 +26,17 @@ class WorkerThread(QtCore.QThread): def __init__(self,args): QtCore.QThread.__init__(self) self.args = args - - + + def __del__(self): self.wait() - + def run(self): - print "Worker Thread Calling Command :",self.args + print("Worker Thread Calling Command :",self.args) self.call_system(self.args) - + def call_system(self,command): procThread = Appconfig() proc = subprocess.Popen(command.split()) procThread.procThread_list.append(proc) - procThread.proc_dict[procThread.current_project['ProjectName']].append(proc.pid) - - - - + procThread.proc_dict[procThread.current_project['ProjectName']].append(proc.pid) diff --git a/src/projManagement/Worker.py.bak b/src/projManagement/Worker.py.bak new file mode 100644 index 00000000..575ea12c --- /dev/null +++ b/src/projManagement/Worker.py.bak @@ -0,0 +1,46 @@ +#=============================================================================== +# +# FILE: WorkerThread.py +# +# USAGE: --- +# +# DESCRIPTION: This class open all third party application using QT Thread +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: Fahim Khan, fahim.elex@gmail.com +# ORGANIZATION: eSim team at FOSSEE, IIT Bombay. +# CREATED: Tuesday 24 Feb 2015 +# REVISION: --- +#=============================================================================== +from PyQt4 import QtCore +import subprocess +from configuration.Appconfig import Appconfig + +class WorkerThread(QtCore.QThread): + """ + This is Thread class use to run the command + """ + def __init__(self,args): + QtCore.QThread.__init__(self) + self.args = args + + + def __del__(self): + self.wait() + + def run(self): + print("Worker Thread Calling Command :",self.args) + self.call_system(self.args) + + def call_system(self,command): + procThread = Appconfig() + proc = subprocess.Popen(command.split()) + procThread.procThread_list.append(proc) + procThread.proc_dict[procThread.current_project['ProjectName']].append(proc.pid) + + + + diff --git a/src/projManagement/newProject.py b/src/projManagement/newProject.py index 5b4af49a..e8c81d6f 100644 --- a/src/projManagement/newProject.py +++ b/src/projManagement/newProject.py @@ -17,7 +17,7 @@ # REVISION: --- #=============================================================================== from PyQt4 import QtGui -from Validation import Validation +from .Validation import Validation from configuration.Appconfig import Appconfig import os import json diff --git a/src/projManagement/openProject.py b/src/projManagement/openProject.py index d980d914..c71d2181 100644 --- a/src/projManagement/openProject.py +++ b/src/projManagement/openProject.py @@ -18,7 +18,7 @@ #=============================================================================== from PyQt4 import QtGui -from Validation import Validation +from .Validation import Validation from configuration.Appconfig import Appconfig import os import json @@ -40,7 +40,7 @@ class OpenProjectInfo(QtGui.QWidget): if self.obj_validation.validateOpenproj(self.projDir) == True: self.obj_Appconfig.current_project['ProjectName'] = str(self.projDir) if os.path.isdir(self.projDir): - print "true" + print("true") for dirs, subdirs, filelist in os.walk(self.obj_Appconfig.current_project["ProjectName"]): directory = dirs |