# Path: pyxmpp/all.py



import sys
import logging
import pyxmpp.jabberd.all
from pyxmpp.all import JID,Iq,Presence,Message,StreamError,FeatureNotImplementedProtocolError
        q=iq.new_query("jabber:iq:version")
        q.newTextChild(q.ns(),"name","Echo component")
        q.newTextChild(q.ns(),"version","1.0")
        self.stream.send(iq)
        return True

    def get_register(self,iq):
        """Handler for jabber:iq:register 'get' queries.

        jabber:iq:register queries are also not supported directly by PyXMPP,
        see above."""
        to=iq.get_to()
        if to and to!=self.jid:
            raise FeatureNotImplementedProtocolError, "Tried to register at non-null node"
        iq=iq.make_result_response()
        q=iq.new_query("jabber:iq:register")
        q.newTextChild(q.ns(),"instructions","Enter anything below.")
        q.newChild(q.ns(),"username",None)
        q.newChild(q.ns(),"password",None)
        self.stream.send(iq)
        return True

    def set_register(self,iq):
        """Handler for jabber:iq:register 'set' queries.

        This does not do anything usefull (registration data is ignored),
        but shows how to parse request and use Presence stanzas for
        subscription handling."""
        to=iq.get_to()
        if to and to!=self.jid:

# Path: pyxmpp/all.py



# Path: examples/echocomponent.py
import sys
import logging
import pyxmpp.jabberd.all
from pyxmpp.all import JID,Iq,Presence,Message,StreamError,FeatureNotImplementedProtocolError

        q=iq.new_query("jabber:iq:version")
        q.newTextChild(q.ns(),"name","Echo component")
        q.newTextChild(q.ns(),"version","1.0")
        self.stream.send(iq)
        return True

    def get_register(self,iq):
        """Handler for jabber:iq:register 'get' queries.

        jabber:iq:register queries are also not supported directly by PyXMPP,
        see above."""
        to=iq.get_to()
        if to and to!=self.jid:
            raise FeatureNotImplementedProtocolError, "Tried to register at non-null node"
        iq=iq.make_result_response()
        q=iq.new_query("jabber:iq:register")
        q.newTextChild(q.ns(),"instructions","Enter anything below.")
        q.newChild(q.ns(),"username",None)
        q.newChild(q.ns(),"password",None)
        self.stream.send(iq)
        return True

    def set_register(self,iq):
        """Handler for jabber:iq:register 'set' queries.

        This does not do anything usefull (registration data is ignored),
        but shows how to parse request and use Presence stanzas for
        subscription handling."""
        to=iq.get_to()
        if to and to!=self.jid:

            raise FeatureNotImplementedProtocolError, "Tried to register at non-null node"