diff options
author | Sunil Shetye | 2019-06-24 15:39:01 +0530 |
---|---|---|
committer | GitHub | 2019-06-24 15:39:01 +0530 |
commit | ca27e1ab9d418bfece063a38629da4dc09281e45 (patch) | |
tree | db4048b7d093d7827b663b2cac98c5c49e37358e /src/projManagement/Worker.py | |
parent | a5effc6fcfb55751cd60a08f9774391ed34ba711 (diff) | |
parent | e75167f3e98add3912ff5db300f6f4d2535c5325 (diff) | |
download | eSim-ca27e1ab9d418bfece063a38629da4dc09281e45.tar.gz eSim-ca27e1ab9d418bfece063a38629da4dc09281e45.tar.bz2 eSim-ca27e1ab9d418bfece063a38629da4dc09281e45.zip |
Merge pull request #92 from nilshah98/sphinx
Resolves #90
Diffstat (limited to 'src/projManagement/Worker.py')
-rw-r--r-- | src/projManagement/Worker.py | 72 |
1 files changed, 35 insertions, 37 deletions
diff --git a/src/projManagement/Worker.py b/src/projManagement/Worker.py index f40fd724..99d30ccc 100644 --- a/src/projManagement/Worker.py +++ b/src/projManagement/Worker.py @@ -19,16 +19,13 @@ from PyQt4 import QtCore import subprocess from configuration.Appconfig import Appconfig -""" -WorkerThread uses QThread to support threading operations for -other PyQT windows -This is a helper functions, used to create threads for various commands -""" - - class WorkerThread(QtCore.QThread): """ Initialise a QThread with the passed arguments + WorkerThread uses QThread to support threading operations for + 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 @@ -42,48 +39,49 @@ class WorkerThread(QtCore.QThread): QtCore.QThread.__init__(self) self.args = args - """ - __del__ is a called whenever garbage collection is initialised - Here, it waits (self.wait()) for the thread to finish executing - before garbage collecting it - - @params - @return - None - """ def __del__(self): - self.wait() + """ + __del__ is a called whenever garbage collection is initialised + Here, it waits (self.wait()) for the thread to finish executing + before garbage collecting it - """ - run is the function that is called, when we start the thread as - thisThread.start() - Here, it makes system calls for all args passed (self.args) + @params - @params + @return + None + """ + self.wait() - @return - None - """ def run(self): - print("Worker Thread Calling Command :", self.args) - self.call_system(self.args) + """ + run is the function that is called, when we start the thread as + thisThread.start() + Here, it makes system calls for all args passed (self.args) - """ - call_system is used to create childprocess for the passed arguments - (self.args) and also pass the process created and its id to config file - Apponfig() object contains procThread and proc_dist used to - track processes called + @params - @params - :command => (self.args) takes space separated string of comamnds to - be executed in different child processes - (see subproces.Popen()) - """ + @return + None + """ + print("Worker Thread Calling Command :", self.args) + self.call_system(self.args) def call_system(self, command): + """ + call_system is used to create childprocess for the passed arguments + (self.args) and also pass the process created and its id to config file + Apponfig() object contains procThread and proc_dist used to + track processes called + + @params + :command => (self.args) takes space separated string of comamnds to + be executed in different child processes + (see subproces.Popen()) + """ + procThread = Appconfig() proc = subprocess.Popen(command.split()) procThread.procThread_list.append(proc) |