summaryrefslogtreecommitdiff
path: root/src/projManagement/Worker.py
blob: 58078b86e200d5cc22a62258801465b1f90d6dba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#===============================================================================
#
#          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 os


class WorkerThread(QtCore.QThread):
    def __init__(self,args):
        QtCore.QThread.__init__(self)
        self.args = args
    '''
    #Not Required
    def __del__(self):
        self.wait()
        
    '''    
    def run(self):
        print "Calling :",self.args
        self.call_system(self.args)
        
    def call_system(self,command):
        print "System called"
        try:
            os.system(command)
            print "PID",os.getpid()
        except:
            print "Unable to run the command"