Module Expr Str Assign NameStore Str Import alias Import alias Import alias Import alias Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias alias alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias alias Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore BinOpAdd NameLoad Str Assign NameStore BinOpAdd NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad Str attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad For NameStore NameLoad body If Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Dict decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str With AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If NameLoad body Assign AttributeStore NameLoad attr Call NameLoad NameLoad orelse Assign AttributeStore NameLoad attr NameLoad If Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str With AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign NameStore Str orelse Assign NameStore Str Assign AttributeStore NameLoad attr Dict For NameStore AttributeLoad NameLoad attr body If UnaryOpNot Call NameLoad NameLoad NameLoad body Continue For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad body If UnaryOpNot Call NameLoad NameLoad Str body Continue Assign NameStore AttributeLoad NameLoad attr If CompareIn NameLoad AttributeLoad NameLoad attr body Continue If CompareIn AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str With AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str With AttributeLoad NameLoad attr body If AttributeLoad NameLoad attr body If CompareIs AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str With AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr BinOpAdd Str Call NameLoad NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr Str Raise Call NameLoad Str If CompareNotEq AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Str Raise Call NameLoad Str If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Call NameLoad AttributeLoad NameLoad attr orelse Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str If NameLoad body TryExcept body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Num Assign TupleStore NameStore NameStore TupleLoad Call NameLoad NameLoad Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Str Raise Call NameLoad Str Assign AttributeStore NameLoad attr TupleLoad NameLoad NameLoad orelse Assign AttributeStore NameLoad attr TupleLoad Num Num If BoolOpAnd CompareNotEq SubscriptLoad AttributeLoad NameLoad attr Index Num Num CompareNotEq AttributeLoad NameLoad attr TupleLoad Num Num body Expr Call AttributeLoad NameLoad attr Str Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Assign NameStore NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str While NameLoad body If CompareIn NameLoad NameLoad body Assign NameStore NameLoad Break Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Break Assign NameStore Call AttributeLoad NameLoad attr Num If NameLoad body Assign AttributeStore NameLoad attr NameLoad If AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str If NameLoad body Assign NameStore Call NameLoad NameLoad If AttributeLoad NameLoad attr body If BoolOpAnd NameLoad CompareNotEq NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr Str If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Str Raise Call NameLoad Str Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str If NameLoad body Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str With AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str With AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Raise Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If CompareIn AttributeLoad NameLoad attr TupleLoad Str Str body Raise Call NameLoad Str If UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Str If NameLoad body Assign NameStore Call NameLoad NameLoad orelse If BoolOpAnd AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore NameLoad If BoolOpAnd AttributeLoad NameLoad attr BoolOpOr AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr body Assign NameStore Call NameLoad AttributeLoad NameLoad attr If NameLoad body Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str With AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareIs AttributeLoad NameLoad attr Str body Return If CompareIn AttributeLoad NameLoad attr TupleLoad NameLoad Str body Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call NameLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str With AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str With AttributeLoad NameLoad attr body Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr If CompareIn NameLoad AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad If NameLoad body Return If Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad orelse If CompareEq NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad orelse If CompareEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str With AttributeLoad NameLoad attr body If AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareNotEq NameLoad AttributeLoad NameLoad attr body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad If UnaryOpNot NameLoad body Assign NameStore ListLoad Assign NameStore ListLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr For NameStore AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Continue orelse If Call NameLoad NameLoad NameLoad body If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Break Break orelse If Call NameLoad NameLoad NameLoad body If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Break orelse Raise Call NameLoad Call AttributeLoad Str attr NameLoad If BoolOpAnd NameLoad UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Str Raise Call NameLoad BinOpAdd Str Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return BoolOpAnd Call AttributeLoad AttributeLoad NameLoad attr attr CompareEq AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str With AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str With AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return ListLoad SubscriptLoad NameLoad Index Str decorator_list Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword AttributeLoad NameLoad attr keyword NameLoad keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Dict keyword Str
N/A N/A Core XMPP stream functionality.

Normative reference:
  - `RFC 6120 <http://xmpp.org/rfcs/rfc6120.html>`__
 N/A __docformat__ restructuredtext en N/A inspect N/A logging N/A uuid N/A re N/A threading etree ElementTree element_to_unicode xmppparser XMLStreamHandler error StreamErrorElement jid JID exceptions StreamError exceptions FatalStreamError StreamParseError constants STREAM_QNP XML_LANG_QNAME STREAM_ROOT_TAG settings XMPPSettings xmppserializer serialize streamevents StreamConnectedEvent GotFeaturesEvent streamevents AuthenticatedEvent StreamRestartedEvent stanzaprocessor stanza_factory interfaces StreamFeatureHandler interfaces StreamFeatureHandled StreamFeatureNotHandled N/A logger N/A N/A logging getLogger pyxmpp2.streambase N/A LANG_SPLIT_RE N/A N/A re compile (.*)(?:-[a-zA-Z0-9])?-[a-zA-Z0-9]+$ N/A ERROR_TAG N/A STREAM_QNP error N/A FEATURES_TAG N/A STREAM_QNP features N/A IP_RE N/A N/A re compile ^((\d+.){3}\d+)|([0-9a-f]*:[0-9a-f:]*:[0-9a-f]*)$ StreamBase N/A XMLStreamHandler N/A N/A Base class for a generic XMPP stream.

    Responsible for establishing connection, parsing the stream, handling
    stream elements and passing stanzas receiver to other object.
    This doesn't provide any authentication or encryption (both required by
    the XMPP specification) and is not usable on its own.

    Whenever we say "stream" here we actually mean two streams
    (incoming and outgoing) of one connections, as defined by the XMPP
    specification.

    :Ivariables:
        - `authenticated`: `True` if local entity has authenticated to peer
        - `features`: stream features as annouced by the receiver.
        - `handlers`: handlers for stream elements
        - `initiator`: `True` if local stream endpoint is the initiating entity.
        - `lock`: RLock object used to synchronize access to Stream object.
        - `me`: local stream endpoint JID.
        - `peer_authenticated`: `True` if the peer has authenticated to us
        - `peer_language`: language of human-readable stream content selected
          by the peer
        - `peer`: remote stream endpoint JID.
        - `settings`: stream settings
        - `stanza_namespace`: default namespace of the stream
        - `tls_established`: `True` when the stream is protected by TLS
        - `transport`: transport used by this stream
        - `version`: Negotiated version of the XMPP protocol. (0,9) for the
          legacy (pre-XMPP) Jabber protocol.
        - `_element_handlers`: mapping from stream element names to lists of
          methods handling them
        - `_input_state`: `None`, "open" (<stream:stream> has been received)
          "restart" or "closed" (</stream:stream> or EOF has been received)
        - `_output_state`: `None`, "open" (<stream:stream> has been received)
          "restart" or "closed" (</stream:stream> or EOF has been received)
        - `_stanza_namespace_p`: qname prefix of the stanza namespace
        - `_stream_feature_handlers`: stream features handlers
    :Types:
        - `authenticated`: `bool`
        - `features`: :etree:`ElementTree.Element`
        - `handlers`: `list`
        - `initiator`: `bool`
        - `lock`: :std:`threading.RLock`
        - `me`: `JID`
        - `peer_authenticated`: `bool`
        - `peer_language`: `str`
        - `peer`: `JID`
        - `settings`: XMPPSettings
        - `stanza_namespace`: `str`
        - `tls_established`: `bool`
        - `transport`: `transport.XMPPTransport`
        - `version`: (`int`, `int`) tuple
        - `_element_handlers`: `dict`
        - `_input_state`: `str`
        - `_output_state`: `str`
        - `_stanza_namespace_p`: `str`
        - `_stream_feature_handlers`: `list` of `StreamFeatureHandler`
     __init__ N/A N/A self stanza_namespace stanza_route handlers settings N/A None N/A N/A Initialize StreamBase object

        :Parameters:
          - `stanza_namespace`: stream's default namespace URI ("jabber:client"
            for client, "jabber:server" for server, etc.)
          - `stanza_route`: object to handle received stanzas
          - `handlers`: objects to handle the stream events and elements
          - `settings`: extra settings
        :Types:
          - `stanza_namespace`: `str`
          - `stanza_route`: `StanzaRoute`
          - `settings`: XMPPSettings
          - `handlers`: `list` of objects
         N/A N/A N/A XMLStreamHandler __init__ self N/A N/A self lock N/A N/A threading RLock N/A N/A settings None N/A N/A settings N/A XMPPSettings N/A N/A self settings settings N/A N/A self stanza_namespace stanza_namespace N/A N/A self _stanza_namespace_p N/A N/A {{{0}}} format stanza_namespace N/A N/A self stanza_route stanza_route N/A N/A self handlers handlers N/A N/A self _stream_feature_handlers N/A N/A handler handlers N/A N/A N/A isinstance handler StreamFeatureHandler N/A N/A N/A N/A N/A self _stream_feature_handlers append handler N/A N/A self me None N/A N/A self peer None N/A N/A self stream_id None N/A N/A self initiator None N/A N/A self features None N/A N/A self authenticated False N/A N/A self peer_authenticated False N/A N/A self tls_established False N/A N/A self auth_method_used None N/A N/A self version None N/A N/A self language None N/A N/A self peer_language None N/A N/A self transport None N/A N/A self _input_state None N/A N/A self _output_state None N/A N/A self _element_handlers N/A N/A initiate N/A N/A self transport to N/A None N/A N/A Initiate an XMPP connection over the `transport`.
        
        :Parameters:
            - `transport`: an XMPP transport instance
            - `to`: peer name
         N/A N/A self lock N/A N/A N/A self initiator True N/A N/A self transport transport N/A N/A N/A transport set_target self N/A to N/A N/A N/A self peer N/A JID to N/A N/A N/A self peer None N/A N/A N/A transport is_connected N/A N/A N/A N/A self _initiate N/A _initiate N/A N/A self N/A N/A N/A Initiate an XMPP connection over a connected `transport`.

        [ called with `lock` acquired ]
         N/A N/A N/A self _setup_stream_element_handlers N/A N/A N/A self _send_stream_start N/A receive N/A N/A self transport myname N/A N/A N/A Receive an XMPP connection over the `transport`.

        :Parameters:
            - `transport`: an XMPP transport instance
            - `myname`: local stream endpoint name.
         N/A N/A self lock N/A N/A N/A self transport transport N/A N/A N/A transport set_target self N/A N/A self me N/A JID myname N/A N/A self initiator False N/A N/A N/A self _setup_stream_element_handlers N/A _setup_stream_element_handlers N/A N/A self N/A N/A N/A Set up stream element handlers.
        
        Scans the `handlers` list for `StreamFeatureHandler`
        instances and updates `_element_handlers` mapping with their
        methods decorated with @`stream_element_handler`
         N/A N/A self initiator N/A N/A mode initiator N/A N/A mode receiver N/A N/A self _element_handlers N/A N/A handler N/A self handlers N/A N/A N/A N/A isinstance handler StreamFeatureHandler N/A N/A N/A N/A _unused meth N/A N/A inspect getmembers handler callable N/A N/A N/A N/A hasattr meth _pyxmpp_stream_element_handled N/A N/A N/A element_handled N/A meth _pyxmpp_stream_element_handled N/A N/A element_handled N/A self _element_handlers N/A N/A N/A N/A N/A meth _pyxmpp_usage_restriction N/A None mode N/A N/A N/A N/A self _element_handlers N/A element_handled meth N/A disconnect N/A N/A self N/A N/A N/A Gracefully close the connection. N/A N/A self lock N/A N/A N/A N/A N/A self transport disconnect N/A N/A self _output_state closed N/A event N/A N/A self event N/A N/A N/A Handle a stream event.
        
        Called when connection state is changed.

        Should not be called with self.lock acquired!
         N/A N/A event stream self N/A N/A N/A logger debug N/A N/A Stream event: {0} format event N/A N/A N/A N/A N/A self settings N/A event_queue put event N/A False N/A transport_connected N/A N/A self N/A N/A N/A Called when transport has been connected.

        Send the stream head if initiator.
         N/A N/A self lock N/A N/A N/A self initiator N/A N/A N/A N/A self _output_state None N/A N/A N/A N/A self _initiate N/A close N/A N/A self N/A N/A N/A Forcibly close the connection and clear the stream state. N/A N/A N/A N/A self transport close N/A stream_start N/A N/A self element N/A N/A N/A Process <stream:stream> (stream start) tag received from peer.
        
        `lock` is acquired when this method is called.

        :Parameters:
            - `element`: root element (empty) created by the parser N/A N/A self lock N/A N/A N/A N/A logger debug N/A input document:  N/A element_to_unicode element N/A N/A N/A N/A N/A element tag startswith STREAM_QNP N/A N/A N/A N/A self _send_stream_error invalid-namespace N/A N/A FatalStreamError Bad stream namespace N/A N/A N/A element tag STREAM_ROOT_TAG N/A N/A N/A N/A self _send_stream_error bad-format N/A N/A FatalStreamError Bad root element N/A N/A N/A self _input_state restart N/A N/A event N/A StreamRestartedEvent N/A self peer N/A N/A event N/A StreamConnectedEvent N/A self peer N/A N/A self _input_state open N/A version N/A N/A element get version N/A version N/A N/A N/A N/A N/A major minor N/A N/A version split . 1 N/A N/A major minor N/A N/A int major N/A int minor N/A N/A N/A ValueError N/A N/A N/A N/A self _send_stream_error unsupported-version N/A N/A FatalStreamError Unsupported protocol version. N/A N/A self version N/A major minor N/A N/A N/A self version N/A 0 9 N/A N/A N/A N/A N/A self version N/A 0 1 N/A N/A self version N/A 0 9 N/A N/A N/A N/A self _send_stream_error unsupported-version N/A N/A FatalStreamError Unsupported protocol version. N/A peer_lang N/A N/A element get XML_LANG_QNAME N/A N/A self peer_language peer_lang N/A N/A N/A self initiator N/A N/A lang None N/A languages N/A N/A self settings N/A languages N/A peer_lang N/A N/A N/A peer_lang languages N/A N/A lang peer_lang N/A N/A match N/A N/A LANG_SPLIT_RE match peer_lang N/A N/A match N/A N/A N/A peer_lang N/A N/A match group 0 N/A lang N/A N/A N/A self language lang N/A N/A self initiator N/A N/A N/A self stream_id N/A N/A element get id N/A peer N/A N/A element get from N/A peer N/A N/A peer N/A JID peer N/A N/A self peer N/A N/A N/A peer N/A peer N/A self peer N/A N/A N/A N/A logger debug N/A N/A peer hostname mismatch: {0!r} != {1!r} format peer N/A self peer N/A N/A self peer peer N/A N/A to N/A N/A element get to N/A to N/A N/A to N/A N/A self check_to to N/A N/A to N/A N/A N/A N/A self _send_stream_error host-unknown N/A N/A FatalStreamError Bad "to" N/A N/A self me N/A JID to N/A peer N/A N/A element get from N/A peer N/A N/A peer N/A JID peer N/A N/A N/A self _send_stream_start N/A N/A self generate_id stream_to peer N/A N/A N/A self _send_stream_features N/A N/A N/A self event event N/A stream_end N/A N/A self N/A N/A N/A Process </stream:stream> (stream end) tag received from peer.
         N/A N/A N/A logger debug Stream ended N/A N/A self lock N/A N/A N/A self _input_state closed N/A N/A N/A N/A self transport disconnect N/A N/A self _output_state closed N/A stream_eof N/A N/A self N/A N/A N/A Process stream EOF.
         N/A N/A N/A self stream_end N/A stream_element N/A N/A self element N/A N/A N/A Process first level child element of the stream).

        :Parameters:
            - `element`: XML element received
        :Types:
            - `element`: :etree:`ElementTree.Element`
         N/A N/A self lock N/A N/A N/A N/A self _process_element element N/A stream_parse_error N/A N/A self descr N/A N/A N/A Called when an error is encountered in the stream.

        :Parameters:
            - `descr`: description of the error
        :Types:
            - `descr`: `str` N/A N/A N/A self send_stream_error not-well-formed N/A N/A StreamParseError descr N/A _send_stream_start N/A N/A self stream_id stream_to N/A None None N/A N/A Send stream start tag. N/A N/A N/A self _output_state N/A open closed N/A N/A N/A StreamError Stream start already sent N/A N/A N/A self language N/A N/A N/A self language N/A N/A self settings N/A language N/A stream_to N/A N/A stream_to N/A str stream_to N/A N/A N/A N/A self peer N/A self initiator N/A N/A stream_to N/A str N/A self peer N/A stream_from None N/A N/A N/A self me N/A N/A self tls_established N/A N/A self initiator N/A N/A stream_from N/A str N/A self me N/A stream_id N/A N/A N/A self stream_id stream_id N/A N/A N/A self stream_id None N/A N/A N/A N/A self transport send_stream_head N/A self stanza_namespace stream_from stream_to N/A self stream_id language N/A self language N/A N/A self _output_state open N/A send_stream_error N/A N/A self condition N/A N/A N/A Send stream error element.

        :Parameters:
            - `condition`: stream error condition name, as defined in the
              XMPP specification.
         N/A N/A self lock N/A N/A N/A N/A self _send_stream_error condition N/A _send_stream_error N/A N/A self condition N/A N/A N/A Same as `send_stream_error`, but expects `lock` acquired.
         N/A N/A N/A self _output_state closed N/A N/A N/A N/A N/A self _output_state N/A None restart N/A N/A N/A N/A self _send_stream_start N/A element N/A N/A N/A StreamErrorElement condition as_xml N/A N/A N/A N/A self transport send_element element N/A N/A N/A N/A self transport disconnect N/A N/A self _output_state closed N/A _restart_stream N/A N/A self N/A N/A N/A Restart the stream as needed after SASL and StartTLS negotiation. N/A N/A self _input_state restart N/A N/A self _output_state restart N/A N/A self features None N/A N/A N/A N/A self transport restart N/A N/A self initiator N/A N/A N/A N/A self _send_stream_start N/A self stream_id N/A _make_stream_features N/A N/A self N/A N/A N/A Create the <features/> element for the stream.

        [receving entity only]

        :returns: new <features/> element
        :returntype: :etree:`ElementTree.Element` N/A features N/A N/A ElementTree Element FEATURES_TAG N/A handler N/A self _stream_feature_handlers N/A N/A N/A N/A handler make_stream_features self features N/A features N/A _send_stream_features N/A N/A self N/A N/A N/A Send stream <features/>.

        [receiving entity only] N/A N/A self features N/A N/A self _make_stream_features N/A N/A N/A self _write_element N/A self features N/A write_element N/A N/A self element N/A N/A N/A Write XML `element` to the stream.

        :Parameters:
            - `element`: Element node to send.
        :Types:
            - `element`: :etree:`ElementTree.Element`
         N/A N/A self lock N/A N/A N/A N/A self _write_element element N/A _write_element N/A N/A self element N/A N/A N/A Same as `write_element` but with `lock` already acquired.
         N/A N/A N/A N/A self transport send_element element N/A send N/A N/A self stanza N/A N/A N/A Write stanza to the stream.

        :Parameters:
            - `stanza`: XMPP stanza to send.
        :Types:
            - `stanza`: `pyxmpp2.stanza.Stanza`
         N/A N/A self lock N/A N/A N/A N/A self _send stanza N/A _send N/A N/A self stanza N/A N/A N/A Same as `send` but assume `lock` is acquired. N/A N/A N/A self fix_out_stanza stanza N/A element N/A N/A stanza as_xml N/A N/A N/A self _write_element element N/A _process_element N/A N/A self element N/A N/A N/A Process first level element of the stream.

        The element may be stream error or features, StartTLS
        request/response, SASL request/response or a stanza.

        :Parameters:
            - `element`: XML element
        :Types:
            - `element`: :etree:`ElementTree.Element`
         N/A tag N/A element tag N/A N/A tag N/A self _element_handlers N/A N/A handler N/A N/A self _element_handlers N/A tag N/A N/A N/A logger debug N/A N/A Passing element {0!r} to method {1!r} format element handler N/A handled N/A handler self element N/A handled N/A N/A N/A N/A N/A tag startswith N/A self _stanza_namespace_p N/A N/A stanza N/A stanza_factory element self N/A self language N/A N/A N/A self uplink_receive stanza N/A N/A N/A tag ERROR_TAG N/A N/A error N/A StreamErrorElement element N/A N/A N/A self process_stream_error error N/A N/A N/A tag FEATURES_TAG N/A N/A N/A N/A logger debug N/A N/A Got features element: {0} format N/A serialize element N/A N/A N/A self _got_features element N/A N/A N/A N/A logger debug N/A N/A Unhandled element: {0} format N/A serialize element N/A N/A N/A logger debug N/A N/A  known handlers: {0!r} format N/A self _element_handlers N/A uplink_receive N/A N/A self stanza N/A N/A N/A Handle stanza received from the stream. N/A N/A self lock N/A N/A N/A self stanza_route N/A N/A N/A N/A N/A self stanza_route uplink_receive stanza N/A N/A N/A N/A logger debug N/A N/A Stanza dropped (no route): {0!r} format stanza N/A process_stream_error N/A N/A self error N/A N/A N/A Process stream error element received.

        :Parameters:
            - `error`: error received

        :Types:
            - `error`: `StreamErrorElement`
         N/A N/A N/A logger debug N/A N/A Unhandled stream error: condition: {0} {1!r} format N/A error condition_name N/A N/A error serialize N/A check_to N/A N/A self to N/A N/A N/A Check "to" attribute of received stream header.

        :return: `to` if it is equal to `me`, None otherwise.

        Should be overriden in derived classes which require other logic
        for handling that attribute. N/A N/A to N/A self me N/A N/A None N/A to N/A generate_id N/A N/A self N/A N/A N/A Generate a random and unique stream ID.

        :return: the id string generated. N/A N/A str N/A N/A uuid uuid4 N/A _got_features N/A N/A self features N/A N/A N/A Process incoming <stream:features/> element.

        [initiating entity only]

        The received features node is available in `features`. N/A N/A self features features N/A N/A N/A logger debug got features, passing to event handlers... N/A handled N/A N/A self event N/A GotFeaturesEvent N/A self features N/A N/A N/A logger debug N/A N/A   handled: {0} format handled N/A N/A handled N/A N/A mandatory_handled N/A N/A mandatory_not_handled N/A N/A N/A N/A logger debug N/A N/A   passing to stream features handlers: {0} format N/A self _stream_feature_handlers N/A handler N/A self _stream_feature_handlers N/A N/A ret N/A N/A handler handle_stream_features self N/A self features N/A N/A ret None N/A N/A N/A N/A N/A isinstance ret StreamFeatureHandled N/A N/A N/A ret mandatory N/A N/A N/A N/A mandatory_handled append N/A str ret N/A N/A N/A N/A N/A isinstance ret StreamFeatureNotHandled N/A N/A N/A ret mandatory N/A N/A N/A N/A mandatory_not_handled append N/A str ret N/A N/A N/A N/A ValueError N/A N/A Wrong value returned from a stream feature handler: {0!r} format ret N/A N/A mandatory_not_handled N/A mandatory_handled N/A N/A N/A N/A self send_stream_error unsupported-feature N/A N/A FatalStreamError N/A Unsupported mandatory-to-implement features:  N/A N/A join mandatory_not_handled N/A is_connected N/A N/A self N/A N/A N/A Check if stream is is_connected and stanzas may be sent.

        :return: True if stream connection is active. N/A N/A N/A N/A N/A self transport is_connected N/A N/A self _output_state open N/A set_peer_authenticated N/A N/A self peer restart_stream N/A False N/A N/A Mark the other side of the stream authenticated as `peer`

        :Parameters:
            - `peer`: local JID just authenticated
            - `restart_stream`: `True` when stream should be restarted (needed
              after SASL authentication)
        :Types:
            - `peer`: `JID`
            - `restart_stream`: `bool`
         N/A N/A self lock N/A N/A N/A self peer_authenticated True N/A N/A self peer peer N/A restart_stream N/A N/A N/A N/A self _restart_stream N/A N/A N/A self event N/A AuthenticatedEvent N/A self peer N/A set_authenticated N/A N/A self me restart_stream N/A False N/A N/A Mark stream authenticated as `me`.

        :Parameters:
            - `me`: local JID just authenticated
            - `restart_stream`: `True` when stream should be restarted (needed
              after SASL authentication)
        :Types:
            - `me`: `JID`
            - `restart_stream`: `bool`
         N/A N/A self lock N/A N/A N/A self authenticated True N/A N/A self me me N/A restart_stream N/A N/A N/A N/A self _restart_stream N/A N/A N/A self event N/A AuthenticatedEvent N/A self me N/A fix_in_stanza N/A N/A self stanza N/A N/A N/A Fix incoming stanza, setting the implicit fields.

        Used for for servers side of client stream to set proper stanza from.
         N/A stanza N/A fix_out_stanza N/A N/A self stanza N/A N/A N/A Fix outgoing, setting or clearing the implicit fields.

        Used for for client side of client stream to clear the 'from'
        attribute.
         N/A stanza N/A N/A _languages_factory N/A N/A settings N/A N/A N/A Make the default value of the :r:`languages setting`. N/A N/A N/A settings N/A language N/A N/A N/A N/A XMPPSettings add_setting language type str default en cmdline_help Preferred language of the XMPP stream doc The preferred language of the XMPP stream. N/A N/A N/A XMPPSettings add_setting languages type list of ``unicode`` validator N/A XMPPSettings validate_string_list factory _languages_factory cmdline_help Accepted languages of the XMPP stream doc When the remote entity selects one of these languages
on their stream, the same language will be sent in our stream declaration. N/A N/A N/A XMPPSettings add_setting extra_ns_prefixes type prefix -> uri mapping default N/A doc Extra namespace prefix declarations to use at the stream root
element.