Back to index

system-config-printer  1.3.9+20120706
Public Member Functions | Public Attributes
timedops.OperationThread Class Reference

List of all members.

Public Member Functions

def __init__
def run
def collect_result

Public Attributes

 target
 args
 kwargs
 exception
 result

Detailed Description

Definition at line 136 of file timedops.py.


Constructor & Destructor Documentation

def timedops.OperationThread.__init__ (   self,
  target = None,
  args = (),
  kwargs = {} 
)

Definition at line 137 of file timedops.py.

00137 
00138     def __init__ (self, target=None, args=(), kwargs={}):
00139         threading.Thread.__init__ (self)
00140         self.setDaemon (True)
00141         self.target = target
00142         self.args = args
00143         self.kwargs = kwargs
00144         self.exception = None
00145         self.result = None


Member Function Documentation

Definition at line 155 of file timedops.py.

00155 
00156     def collect_result (self):
00157         if self.isAlive ():
00158             # We've been canceled.
00159             raise OperationCanceled()
00160 
00161         if self.exception:
00162             raise self.exception
00163 
00164         return self.result

Definition at line 146 of file timedops.py.

00146 
00147     def run (self):
00148         try:
00149             debugprint ("Calling %s" % self.target)
00150             self.result = self.target (*self.args, **self.kwargs)
00151             debugprint ("Done")
00152         except Exception, e:
00153             debugprint ("Caught exception %s" % e)
00154             self.exception = e


Member Data Documentation

Definition at line 141 of file timedops.py.

Definition at line 143 of file timedops.py.

Definition at line 142 of file timedops.py.

Definition at line 144 of file timedops.py.

Definition at line 140 of file timedops.py.


The documentation for this class was generated from the following file: