Package gammu :: Module Worker :: Class GammuThread
[hide private]
[frames] | no frames]

Class GammuThread

source code

        object --+        
                 |        
threading._Verbose --+    
                     |    
      threading.Thread --+
                         |
                        GammuThread

Thread for phone communication.

Instance Methods [hide private]
 
__init__(self, queue, config, callback)
Initialises thread data.
source code
 
_do_command(self, name, cmd, params, percentage=100)
Executes single command on phone.
source code
 
run(self)
Thread body, which handles phone communication.
source code
 
kill(self)
Forces thread end without emptying queue.
source code
 
join(self, timeout=None)
Terminates thread and waits for it.
source code

Inherited from threading.Thread: __repr__, getName, isAlive, isDaemon, setDaemon, setName, start

Inherited from threading.Thread (private): _set_daemon

Inherited from threading._Verbose (private): _note

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, queue, config, callback)
(Constructor)

source code 
Initialises thread data.
Parameters:
  • queue (Queue.Queue object.) - Queue with events.
  • config (hash) - Gammu configuration, same as StateMachine.SetConfig accepts.
  • callback (Function, needs to accept four params: name of completed operation, result of it, error code and percentage of overall operation. This callback is called from different thread, so please take care of various threading issues in other modules you use.) - Function which will be called upon operation completing.
Overrides: threading.Thread.__init__

run(self)

source code 
Thread body, which handles phone communication. This should not be used from outside.
Overrides: threading.Thread.run

join(self, timeout=None)

source code 
Terminates thread and waits for it.
Overrides: threading.Thread.join