Package xmpp :: Module commands :: Class Commands

[hide private]
[frames] | no frames]

# Class Commands

source code

    client.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.

Instance Methods | [hide private]

__init__(self, browser) Initialises class and sets up local variables | source code

plugin(self, owner) Makes handlers within the session | source code

plugout(self) Removes handlers from the session | source code

_CommandHandler(self, conn, request) The internal method to process the routing of command execution requests | source code

_DiscoHandler(self, conn, request, typ) The internal method to process service discovery requests | source code

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 | source code

delCommand(self, name, jid=`'````'`) Removed command from the session | source code

getCommand(self, name, jid=`'````'`) Returns the command tuple | source code

Inherited from `client.PlugIn`: `DEBUG`, `PlugIn`, `PlugOut`

Method Details | [hide private]

### __init__(self, browser)
(Constructor)

source code

Initialises class and sets up local variables

Overrides: client.PlugIn.__init__