| Home | Trees | Index | Help |
|---|
| Package xmpp :: Module commands :: Class Command_Handler_Prototype |
|
PlugIn --+
|
Command_Handler_Prototype
TestCommand
This is a prototype command handler, as each command uses a disco method
and execute method you can implement it any way you like, however this is
my first attempt at making a generic handler that you can hang process
stages on too. There is an example command below.
The parameters are as follows:
name : the name of the command within the jabber environment
description : the natural language description
discofeatures : the features supported by the command
initial : the initial command in the from of {'execute':commandname}
All stages set the 'actions' dictionary for each session to represent the possible options available.
| Method Summary | |
|---|---|
Set up the class | |
The method that handles all the commands, and routes them to the correct method for that stage. | |
Returns an id for the command session | |
Plug command into the commands class | |
Remove command from the commands class | |
| Inherited from PlugIn | |
Feed a provided debug line to main instance's debug facility along with our ID string. | |
Attach to main instance and register ourself and all our staff in it. | |
Unregister all our staff from main instance and detach from it. | |
| Class Variable Summary | |
|---|---|
int |
count = 0 |
str |
description = 'an example command'
|
list |
discofeatures = ['http://jabber.org/protocol/commands', ...
|
str |
name = 'examplecommand'
|
| Method Details |
|---|
__init__(self,
jid='')
Set up the class
|
Execute(self, conn, request)The method that handles all the commands, and routes them to the correct method for that stage. |
getSessionID(self)Returns an id for the command session |
plugin(self, owner)Plug command into the commands class |
plugout(self)Remove command from the commands class |
| Class Variable Details |
|---|
count
|
description
|
discofeatures
|
name
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Mon Mar 6 14:11:54 2006 | http://epydoc.sf.net |