diff options
author | Florent Le Coz <louiz@louiz.org> | 2014-07-17 14:19:04 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2014-07-17 14:19:04 +0200 |
commit | 5ab77c745270d7d5c016c1dc7ef2a82533a4b16e (patch) | |
tree | 259377cc666f8b9c7954fc4e7b8f7a912bcfe101 /sleekxmpp/plugins/xep_0128/static.py | |
parent | e5582694c07236e6830c20361840360a1dde37f3 (diff) | |
download | slixmpp-5ab77c745270d7d5c016c1dc7ef2a82533a4b16e.tar.gz slixmpp-5ab77c745270d7d5c016c1dc7ef2a82533a4b16e.tar.bz2 slixmpp-5ab77c745270d7d5c016c1dc7ef2a82533a4b16e.tar.xz slixmpp-5ab77c745270d7d5c016c1dc7ef2a82533a4b16e.zip |
Rename to slixmpp
Diffstat (limited to 'sleekxmpp/plugins/xep_0128/static.py')
-rw-r--r-- | sleekxmpp/plugins/xep_0128/static.py | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/sleekxmpp/plugins/xep_0128/static.py b/sleekxmpp/plugins/xep_0128/static.py deleted file mode 100644 index 427011c0..00000000 --- a/sleekxmpp/plugins/xep_0128/static.py +++ /dev/null @@ -1,73 +0,0 @@ -""" - SleekXMPP: The Sleek XMPP Library - Copyright (C) 2010 Nathanael C. Fritz, Lance J.T. Stout - This file is part of SleekXMPP. - - See the file LICENSE for copying permission. -""" - -import logging - -import sleekxmpp -from sleekxmpp.plugins.xep_0030 import StaticDisco - - -log = logging.getLogger(__name__) - - -class StaticExtendedDisco(object): - - """ - Extend the default StaticDisco implementation to provide - support for extended identity information. - """ - - def __init__(self, static): - """ - Augment the default XEP-0030 static handler object. - - Arguments: - static -- The default static XEP-0030 handler object. - """ - self.static = static - - def set_extended_info(self, jid, node, ifrom, data): - """ - Replace the extended identity data for a JID/node combination. - - The data parameter may provide: - data -- Either a single data form, or a list of data forms. - """ - with self.static.lock: - self.del_extended_info(jid, node, ifrom, data) - self.add_extended_info(jid, node, ifrom, data) - - def add_extended_info(self, jid, node, ifrom, data): - """ - Add additional extended identity data for a JID/node combination. - - The data parameter may provide: - data -- Either a single data form, or a list of data forms. - """ - with self.static.lock: - self.static.add_node(jid, node) - - forms = data.get('data', []) - if not isinstance(forms, list): - forms = [forms] - - info = self.static.get_node(jid, node)['info'] - for form in forms: - info.append(form) - - def del_extended_info(self, jid, node, ifrom, data): - """ - Replace the extended identity data for a JID/node combination. - - The data parameter is not used. - """ - with self.static.lock: - if self.static.node_exists(jid, node): - info = self.static.get_node(jid, node)['info'] - for form in info['substanza']: - info.xml.remove(form.xml) |