diff options
author | rahulp13 | 2020-02-14 15:16:35 +0530 |
---|---|---|
committer | rahulp13 | 2020-02-14 15:16:35 +0530 |
commit | cb55e59de7ee4383c04edfae7c39ad9ae9552b36 (patch) | |
tree | de1b292a10e8196689bf1a208fe6fe32f4618846 /src/projManagement/Worker.py | |
parent | 08d4a0336550a0e610709970a0c5d366e109fe82 (diff) | |
download | eSim-cb55e59de7ee4383c04edfae7c39ad9ae9552b36.tar.gz eSim-cb55e59de7ee4383c04edfae7c39ad9ae9552b36.tar.bz2 eSim-cb55e59de7ee4383c04edfae7c39ad9ae9552b36.zip |
common code for Win and Linux, merged py2 changes
Diffstat (limited to 'src/projManagement/Worker.py')
-rw-r--r-- | src/projManagement/Worker.py | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/projManagement/Worker.py b/src/projManagement/Worker.py index 9b9f57e4..e523b533 100644 --- a/src/projManagement/Worker.py +++ b/src/projManagement/Worker.py @@ -1,5 +1,4 @@ # ========================================================================= -# # FILE: WorkerThread.py # # USAGE: --- @@ -11,10 +10,12 @@ # BUGS: --- # NOTES: --- # AUTHOR: Fahim Khan, fahim.elex@gmail.com +# MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in # ORGANIZATION: eSim team at FOSSEE, IIT Bombay. -# CREATED: Tuesday 24 Feb 2015 -# REVISION: --- +# CREATED: Tuesday 24 February 2015 +# REVISION: Friday 14 February 2020 # ========================================================================= + from PyQt4 import QtCore import subprocess from configuration.Appconfig import Appconfig @@ -27,7 +28,6 @@ class WorkerThread(QtCore.QThread): other PyQT windows This is a helper functions, used to create threads for various commands - @params :args => takes a space separated string of comamnds to be execute in different child processes (see subproces.Popen()) @@ -39,6 +39,7 @@ class WorkerThread(QtCore.QThread): def __init__(self, args): QtCore.QThread.__init__(self) self.args = args + self.my_workers = [] def __del__(self): """ @@ -53,6 +54,18 @@ class WorkerThread(QtCore.QThread): """ self.wait() + def get_proc_threads(self): + """ + This function is a getter for the list of project's workers, + and is called to check if project's schematic is open or not. + + @params + + @return + :self.my_workers + """ + return self.my_workers + def run(self): """ run is the function that is called, when we start the thread as @@ -82,6 +95,7 @@ class WorkerThread(QtCore.QThread): procThread = Appconfig() proc = subprocess.Popen(command.split()) + self.my_workers.append(proc) procThread.procThread_list.append(proc) procThread.proc_dict[procThread.current_project['ProjectName']].append( proc.pid) |