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

Class Commands

PlugIn --+
         |
        Commands


Commands is an ancestor of PlugIn and can be attached to any session.

The commands class provides a lookup and browse mechnism. It follows the same priciple of the Browser class, for Service Discovery to provide the list of commands, it adds the 'list' disco type to your existing disco handler function. 

How it works:
    The commands are added into the existing Browser on the correct nodes. When the command list is built the supplied discovery handler function needs to have a 'list' option in type. This then gets enumerated, all results returned as None are ignored.
    The command executed is then called using it's Execute method. All session management is handled by the command itself.

Method Summary
  __init__(self, browser)
Initialises class and sets up local variables
  addCommand(self, name, cmddisco, cmdexecute, jid)
The method to call if adding a new command to the session, the requred parameters of cmddisco and cmdexecute are the methods to enable that command to be executed
  delCommand(self, name, jid)
Removed command from the session
  getCommand(self, name, jid)
Returns the command tuple
  plugin(self, owner)
Makes handlers within the session
  plugout(self)
Removes handlers from the session
  _CommandHandler(self, conn, request)
The internal method to process the routing of command execution requests
  _DiscoHandler(self, conn, request, typ)
The internal method to process service discovery requests
    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.

Method Details

__init__(self, browser)
(Constructor)

Initialises class and sets up local variables
Overrides:
xmpp.client.PlugIn.__init__

addCommand(self, name, cmddisco, cmdexecute, jid='')

The method to call if adding a new command to the session, the requred parameters of cmddisco and cmdexecute are the methods to enable that command to be executed

delCommand(self, name, jid='')

Removed command from the session

getCommand(self, name, jid='')

Returns the command tuple

plugin(self, owner)

Makes handlers within the session

plugout(self)

Removes handlers from the session

_CommandHandler(self, conn, request)

The internal method to process the routing of command execution requests

_DiscoHandler(self, conn, request, typ)

The internal method to process service discovery requests

Generated by Epydoc 2.1 on Mon Mar 6 14:11:54 2006 http://epydoc.sf.net