def 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"""
        # This command takes a command object and the name of the command for registration
        # We must:
        #   Add item into disco
        #   Add item into command list
        if not self._handlers.has_key(jid):
            self._handlers[jid]={}
            self._browser.setDiscoHandler(self._DiscoHandler,node=NS_COMMANDS,jid=jid)
        if self._handlers[jid].has_key(name):
            raise NameError,'Command Exists'
        else:
            self._handlers[jid][name]={'disco':cmddisco,'execute':cmdexecute}
        # Need to add disco stuff here
        self._browser.setDiscoHandler(cmddisco,node=name,jid=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
chrome-cordova/gcmServer/xmpp/commands.py