From c6ac40c47655b035c11a3fcd5d40ddf24619934b Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 11 Jan 2011 11:30:56 -0500 Subject: [PATCH 1/4] Update setup.py with latest plugin packages. --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 93c9ab3..b99d160 100644 --- a/setup.py +++ b/setup.py @@ -47,6 +47,8 @@ packages = [ 'sleekxmpp', 'sleekxmpp/plugins', 'sleekxmpp/plugins/xep_0030', 'sleekxmpp/plugins/xep_0030/stanza' + 'sleekxmpp/plugins/xep_0059', + 'sleekxmpp/plugins/xep_0092', ] if sys.version_info < (3, 0): From ba0d699d831975eb4c0f9e5e441bba2972f91806 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Wed, 12 Jan 2011 08:55:33 -0500 Subject: [PATCH 2/4] Fix ordering error in Iq._set_stanza_values. If iq['query'] was set before a plugin that used the query element was set, then the query element was duplicated. --- sleekxmpp/stanza/iq.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/sleekxmpp/stanza/iq.py b/sleekxmpp/stanza/iq.py index 906e664..6388346 100644 --- a/sleekxmpp/stanza/iq.py +++ b/sleekxmpp/stanza/iq.py @@ -199,3 +199,29 @@ class Iq(RootStanza): return waitfor.wait(timeout) else: return StanzaBase.send(self) + + def _set_stanza_values(self, values): + """ + Set multiple stanza interface values using a dictionary. + + Stanza plugin values may be set usind nested dictionaries. + + If the interface 'query' is given, then it will be set + last to avoid duplication of the element. + + Overrides ElementBase._set_stanza_values. + + Arguments: + values -- A dictionary mapping stanza interface with values. + Plugin interfaces may accept a nested dictionary that + will be used recursively. + """ + query = values.get('query', '') + if query: + del values['query'] + StanzaBase._set_stanza_values(self, values) + self['query'] = query + else: + StanzaBase._set_stanza_values(self, values) + return self + From 7d93d1824be88c170a025d57afd3e54a06712d9d Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Wed, 12 Jan 2011 12:22:48 -0500 Subject: [PATCH 3/4] Fix setup.py and old_0004.py typo bugs. --- setup.py | 2 +- sleekxmpp/plugins/old_0004.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index b99d160..4568267 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ packages = [ 'sleekxmpp', 'sleekxmpp/thirdparty', 'sleekxmpp/plugins', 'sleekxmpp/plugins/xep_0030', - 'sleekxmpp/plugins/xep_0030/stanza' + 'sleekxmpp/plugins/xep_0030/stanza', 'sleekxmpp/plugins/xep_0059', 'sleekxmpp/plugins/xep_0092', ] diff --git a/sleekxmpp/plugins/old_0004.py b/sleekxmpp/plugins/old_0004.py index ade3d68..7f08686 100644 --- a/sleekxmpp/plugins/old_0004.py +++ b/sleekxmpp/plugins/old_0004.py @@ -6,7 +6,7 @@ See the file LICENSE for copying permission. """ from . import base -import log +import logging from xml.etree import cElementTree as ET import copy import logging From 632827f213235ab33f08dc133cf50b2c9287cfd0 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Thu, 13 Jan 2011 10:21:20 -0500 Subject: [PATCH 4/4] Fix bug in JID class. Attribute .jid now works properly. --- sleekxmpp/xmlstream/jid.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sleekxmpp/xmlstream/jid.py b/sleekxmpp/xmlstream/jid.py index e5c49dc..5019a25 100644 --- a/sleekxmpp/xmlstream/jid.py +++ b/sleekxmpp/xmlstream/jid.py @@ -71,7 +71,7 @@ class JID(object): if self._domain is None: self._domain = self._jid.split('@', 1)[-1].split('/', 1)[0] return self._domain or "" - elif name == 'full': + elif name in ('full', 'jid'): return self._jid or "" elif name == 'bare': if self._bare is None: