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

Class GammuWorker

source code

Wrapper class for asynchronous communication with Gammu. It spaws own thread and then passes all commands to this thread. When task is done, caller is notified via callback.

Instance Methods [hide private]
 
__init__(self, callback)
Initializes worker class.
source code
 
enqueue_command(self, command, params)
Enqueues command.
source code
 
enqueue_task(self, command, commands)
Enqueues task.
source code
 
enqueue(self, command, params=None, commands=None)
Enqueues command or task.
source code
 
configure(self, config)
Configures gammu instance according to config.
source code
 
abort(self)
Aborts any remaining operations.
source code
 
initiate(self)
Connects to phone.
source code
 
terminate(self)
Terminates phone connection.
source code
Method Details [hide private]

__init__(self, callback)
(Constructor)

source code 
Initializes worker class.
Parameters:

enqueue_command(self, command, params)

source code 
Enqueues command.
Parameters:
  • command (tuple of list of tuples) - Command(s) to execute. Each command is tuple containing function name and it's parameters.
  • params (tuple or string) - Parameters to command.

enqueue_task(self, command, commands)

source code 
Enqueues task.
Parameters:
  • command (tuple of list of tuples) - Command(s) to execute. Each command is tuple containing function name and it's parameters.
  • commands (list of tuples or strings) - List of commands to execute.

enqueue(self, command, params=None, commands=None)

source code 
Enqueues command or task.
Parameters:
  • command (tuple of list of tuples) - Command(s) to execute. Each command is tuple containing function name and it's parameters.
  • params (tuple or string) - Parameters to command.
  • commands (list of tuples or strings) - List of commands to execute. When this is not none, params are ignored and command is taken as task name.

configure(self, config)

source code 
Configures gammu instance according to config.
Parameters: