From cb55e59de7ee4383c04edfae7c39ad9ae9552b36 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Fri, 14 Feb 2020 15:16:35 +0530 Subject: common code for Win and Linux, merged py2 changes --- src/projManagement/Worker.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/projManagement/Worker.py') 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) -- cgit From b173d88ac0059b67e60a042293b1e486c9620d8a Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Fri, 14 Feb 2020 17:21:28 +0530 Subject: pep8 compliant --- src/projManagement/Worker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/projManagement/Worker.py') diff --git a/src/projManagement/Worker.py b/src/projManagement/Worker.py index e523b533..8ced35a7 100644 --- a/src/projManagement/Worker.py +++ b/src/projManagement/Worker.py @@ -60,10 +60,10 @@ class WorkerThread(QtCore.QThread): 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): -- cgit