Package pyxmpp :: Module interfaces |
[hide private]

# Source Code for Module pyxmpp.interfaces

     1  #
     2  # (C) Copyright 2003-2010 Jacek Konieczny <jajcus@jajcus.net>
     3  #
     4  # This program is free software; you can redistribute it and/or modify
     5  # it under the terms of the GNU Lesser General Public License Version
     6  # 2.1 as published by the Free Software Foundation.
     7  #
     8  # This program is distributed in the hope that it will be useful,
     9  # but WITHOUT ANY WARRANTY; without even the implied warranty of
    10  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    11  # GNU Lesser General Public License for more details.
    12  #
    13  # You should have received a copy of the GNU Lesser General Public
    14  # License along with this program; if not, write to the Free Software
    15  # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    16  #
    17
    18  """Interfaces for flexible API extensions."""
    19
    20  __docformat__ = "restructuredtext en"
    21
    22  from pyxmpp.interface import Interface, Attribute
    23
    24 -class IPyXMPPHelper(Interface):
    25      """Base for all interfaces used as PyXMPP helpers."""
    26
    27 -class IPresenceHandlersProvider(IPyXMPPHelper):
    28 -    def get_presence_handlers():
    29          """Returns iterable over (presence_type, handler[, namespace[, priority]]) tuples.
    30
    31          The tuples will be used as arguments for `Stream.set_presence_handler`."""
    32
    33 -class IMessageHandlersProvider(IPyXMPPHelper):
    34 -     def get_message_handlers():
    35          """Returns iterable over (message_type, handler[, namespace[, priority]]) tuples.
    36
    37          The tuples will be used as arguments for `Stream.set_message_handler`."""
    38
    39 -class IIqHandlersProvider(IPyXMPPHelper):
    40 -     def get_iq_get_handlers():
    41          """Returns iterable over (element_name, namespace) tuples.
    42
    43          The tuples will be used as arguments for `Stream.set_iq_get_handler`."""
    44 -     def get_iq_set_handlers():
    45          """Returns iterable over (element_name, namespace) tuples.
    46
    47          The tuples will be used as arguments for `Stream.set_iq_set_handler`."""
    48
    49 -class IStanzaHandlersProvider(IPresenceHandlersProvider, IMessageHandlersProvider, IIqHandlersProvider):
    50      pass
    51
    52 -class IFeaturesProvider(IPyXMPPHelper):
    53 -    def get_features():
    54          """Return iterable of namespaces (features) supported, for disco#info
    55          query response."""
    56
    57
    58  __all__ = [ name for name in dir() if name.startswith("I") and name != "Interface" ]
    59
    60  # vi: sts=4 et sw=4
    61