diff options
Diffstat (limited to 'slixmpp/xmlstream/stanzabase.py')
-rw-r--r-- | slixmpp/xmlstream/stanzabase.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/slixmpp/xmlstream/stanzabase.py b/slixmpp/xmlstream/stanzabase.py index e7ffddc8..605dbb61 100644 --- a/slixmpp/xmlstream/stanzabase.py +++ b/slixmpp/xmlstream/stanzabase.py @@ -147,8 +147,8 @@ def multifactory(stanza, plugin_attrib): Multi.is_extension = True Multi.plugin_attrib = plugin_attrib Multi._multistanza = stanza - Multi.interfaces = set([plugin_attrib]) - Multi.lang_interfaces = set([plugin_attrib]) + Multi.interfaces = {plugin_attrib} + Multi.lang_interfaces = {plugin_attrib} setattr(Multi, "get_%s" % plugin_attrib, get_multi) setattr(Multi, "set_%s" % plugin_attrib, set_multi) setattr(Multi, "del_%s" % plugin_attrib, del_multi) @@ -212,8 +212,8 @@ class ElementBase(object): >>> class Message(ElementBase): ... name = "message" ... namespace = "jabber:client" - ... interfaces = set(('to', 'from', 'type', 'body')) - ... sub_interfaces = set(('body',)) + ... interfaces = {'to', 'from', 'type', 'body'} + ... sub_interfaces = {'body'} The resulting Message stanza's contents may be accessed as so:: @@ -239,7 +239,7 @@ class ElementBase(object): >>> class MessagePlugin(ElementBase): ... name = "custom_plugin" ... namespace = "custom" - ... interfaces = set(('useful_thing', 'custom')) + ... interfaces = {'useful_thing', 'custom'} ... plugin_attrib = "custom" The plugin stanza class must be associated with its intended @@ -311,7 +311,7 @@ class ElementBase(object): #: manipulating the underlying XML object. This set may be augmented #: with the :attr:`plugin_attrib` value of any registered #: stanza plugins. - interfaces = set(('type', 'to', 'from', 'id', 'payload')) + interfaces = {'type', 'to', 'from', 'id', 'payload'} #: A subset of :attr:`interfaces` which maps interfaces to direct #: subelements of the underlying XML object. Using this set, the text @@ -1385,10 +1385,10 @@ class StanzaBase(ElementBase): #: There is a small set of attributes which apply to all XMPP stanzas: #: the stanza type, the to and from JIDs, the stanza ID, and, especially #: in the case of an Iq stanza, a payload. - interfaces = set(('type', 'to', 'from', 'id', 'payload')) + interfaces = {'type', 'to', 'from', 'id', 'payload'} #: A basic set of allowed values for the ``'type'`` interface. - types = set(('get', 'set', 'error', None, 'unavailable', 'normal', 'chat')) + types = {'get', 'set', 'error', None, 'unavailable', 'normal', 'chat'} def __init__(self, stream=None, xml=None, stype=None, sto=None, sfrom=None, sid=None, parent=None): |