Package xmpp :: Module commands :: Class Command_Handler_Prototype
[show private | hide private]
[frames | no frames]

Class Command_Handler_Prototype

PlugIn --+
         |
        Command_Handler_Prototype

Known Subclasses:
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
  __init__(self)
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, jid)
Plug command into the commands class
  plugout(self, jid)
Remove command from the commands class
    Inherited from PlugIn
  DEBUG(self, text, severity)
Feed a provided debug line to main instance's debug facility along with our ID string.
  PlugIn(self, owner)
Attach to main instance and register ourself and all our staff in it.
  PlugOut(self)
Unregister all our staff from main instance and detach from it.

Class Variable Summary
str description = 'an example command'
list discofeatures = ['http://jabber.org/protocol/commands', ...
str name = 'examplecommand'

Method Details

__init__(self)
(Constructor)

Set up the class
Overrides:
xmpp.client.PlugIn.__init__

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, jid='')

Plug command into the commands class

plugout(self, jid)

Remove command from the commands class

Class Variable Details

description

Type:
str
Value:
'an example command'                                                   

discofeatures

Type:
list
Value:
['http://jabber.org/protocol/commands', 'jabber:x:data']               

name

Type:
str
Value:
'examplecommand'                                                       

Generated by Epydoc 2.1 on Wed May 4 07:28:29 2005 http://epydoc.sf.net