Package qm :: Package test :: Module command_thread :: Class CommandThread
[show private | hide private]
[frames | no frames]

Type CommandThread

object --+        
         |        
  _Verbose --+    
             |    
        Thread --+
                 |
                CommandThread


A 'CommandThread' is a thread that executes commands.

The commands are written to a 'Queue' by a controlling thread. The 'CommandThread' extracts the commands and dispatches them to derived class methods that process them. This class is used as a base class for thread classes used by some targets.

The commands are written to the 'Queue' as Python objects. The normal commands have the form '(method, descriptor, context)' where 'method' is a string. At present, the only value used for 'method' is '_RunTest'. In that case 'descriptor' is a test descriptor and 'context' is a 'Context'. The 'Stop' command is provided as a simple string, not a tuple.
Method Summary
  __init__(self, target)
Construct a new 'CommandThread'.
  GetTarget(self)
Return the 'Target' associated with this thread.
  run(self)
Execute the thread.
  RunTest(self, descriptor, context)
Run the test given by 'descriptor'.
  Stop(self)
Stop the thread.
    Inherited from Thread
  __repr__(self)
  getName(self)
  isAlive(self)
  isDaemon(self)
  join(self, timeout)
  setDaemon(self, daemonic)
  setName(self, name)
  start(self)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Method Details

__init__(self, target)
(Constructor)

Construct a new 'CommandThread'.

'target' -- The 'Target' that owns this thread.
Overrides:
threading.Thread.__init__

GetTarget(self)

Return the 'Target' associated with this thread.

returns -- The 'Target' with which this thread is associated.

Derived classes must not override this method.

run(self)

Execute the thread.
Overrides:
threading.Thread.run

RunTest(self, descriptor, context)

Run the test given by 'descriptor'.

'descriptor' -- The 'TestDescriptor' for the test to be run.

'context' -- The 'Context' in which to run the test.

This method is called by the controlling thread.

Derived classes must not override this method.

Stop(self)

Stop the thread.

Derived classes must not override this method.

Generated by Epydoc 2.1 on Thu Sep 27 15:49:00 2007 http://epydoc.sf.net