pyxmpp.interfaces

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  __revision__ = "$Id: error.py 647 2006-08-26 18:27:39Z jajcus $"
    21  __docformat__ = "restructuredtext en"
    22
    23  from pyxmpp.interface import Interface, Attribute
    24
    25 -class IPyXMPPHelper(Interface):
    26      """Base for all interfaces used as PyXMPP helpers."""
    27
    28 -class IPresenceHandlersProvider(IPyXMPPHelper):
    29 -    def get_presence_handlers():
    30          """Returns iterable over (presence_type, handler[, namespace[, priority]]) tuples.
    31
    32          The tuples will be used as arguments for `Stream.set_presence_handler`."""
    33
    34 -class IMessageHandlersProvider(IPyXMPPHelper):
    35 -     def get_message_handlers():
    36          """Returns iterable over (message_type, handler[, namespace[, priority]]) tuples.
    37
    38          The tuples will be used as arguments for `Stream.set_message_handler`."""
    39
    40 -class IIqHandlersProvider(IPyXMPPHelper):
    41 -     def get_iq_get_handlers():
    42          """Returns iterable over (element_name, namespace) tuples.
    43
    44          The tuples will be used as arguments for `Stream.set_iq_get_handler`."""
    45 -     def get_iq_set_handlers():
    46          """Returns iterable over (element_name, namespace) tuples.
    47
    48          The tuples will be used as arguments for `Stream.set_iq_set_handler`."""
    49
    50 -class IStanzaHandlersProvider(IPresenceHandlersProvider, IMessageHandlersProvider, IIqHandlersProvider):
    51      pass
    52
    53 -class IFeaturesProvider(IPyXMPPHelper):
    54 -    def get_features():
    55          """Return iterable of namespaces (features) supported, for disco#info
    56          query response."""
    57
    58
    59  __all__ = [ name for name in dir() if name.startswith("I") and name != "Interface" ]
    60
    61  # vi: sts=4 et sw=4
    62