diff options
author | Lance Stout <lancestout@gmail.com> | 2012-03-11 22:08:19 -0700 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2012-03-12 19:32:19 -0700 |
commit | 4a3a9067d448b2fc328c4db53ff82c503517cf93 (patch) | |
tree | 3116baf6054e4e5f942114fa7b34e822752393d0 /sleekxmpp | |
parent | 1aecb2293aec9473c99e0efec4dad562ec1f23d3 (diff) | |
download | slixmpp-4a3a9067d448b2fc328c4db53ff82c503517cf93.tar.gz slixmpp-4a3a9067d448b2fc328c4db53ff82c503517cf93.tar.bz2 slixmpp-4a3a9067d448b2fc328c4db53ff82c503517cf93.tar.xz slixmpp-4a3a9067d448b2fc328c4db53ff82c503517cf93.zip |
Move XEP-0066 to new system.
Diffstat (limited to 'sleekxmpp')
-rw-r--r-- | sleekxmpp/plugins/xep_0066/__init__.py | 11 | ||||
-rw-r--r-- | sleekxmpp/plugins/xep_0066/oob.py | 17 |
2 files changed, 18 insertions, 10 deletions
diff --git a/sleekxmpp/plugins/xep_0066/__init__.py b/sleekxmpp/plugins/xep_0066/__init__.py index ebfbd0c2..68a50180 100644 --- a/sleekxmpp/plugins/xep_0066/__init__.py +++ b/sleekxmpp/plugins/xep_0066/__init__.py @@ -6,6 +6,15 @@ See the file LICENSE for copying permission. """ +from sleekxmpp.plugins.base import register_plugin + from sleekxmpp.plugins.xep_0066 import stanza from sleekxmpp.plugins.xep_0066.stanza import OOB, OOBTransfer -from sleekxmpp.plugins.xep_0066.oob import xep_0066 +from sleekxmpp.plugins.xep_0066.oob import XEP_0066 + + +register_plugin(XEP_0066) + + +# Retain some backwards compatibility +xep_0066 = XEP_0066 diff --git a/sleekxmpp/plugins/xep_0066/oob.py b/sleekxmpp/plugins/xep_0066/oob.py index 453b555c..6249e9b3 100644 --- a/sleekxmpp/plugins/xep_0066/oob.py +++ b/sleekxmpp/plugins/xep_0066/oob.py @@ -13,19 +13,19 @@ from sleekxmpp.exceptions import XMPPError from sleekxmpp.xmlstream import register_stanza_plugin from sleekxmpp.xmlstream.handler import Callback from sleekxmpp.xmlstream.matcher import StanzaPath -from sleekxmpp.plugins.base import base_plugin +from sleekxmpp.plugins import BasePlugin, register_plugin from sleekxmpp.plugins.xep_0066 import stanza log = logging.getLogger(__name__) -class xep_0066(base_plugin): +class XEP_0066(BasePlugin): """ XEP-0066: Out of Band Data - Out-of-Band Data is a basic method for transferring files between + Out of Band Data is a basic method for transferring files between XMPP agents. The URL of the resource in question is sent to the receiving entity, which then downloads the resource before responding to the OOB request. OOB is also used as a generic means to transmit URLs in other @@ -42,11 +42,13 @@ class xep_0066(base_plugin): or other addressable resource. """ + name = 'xep_0066' + description = 'XEP-0066: Out of Band Data' + dependencies = set(['xep_0030']) + stanza = stanza + def plugin_init(self): """Start the XEP-0066 plugin.""" - self.xep = '0066' - self.description = 'Out of Band Data' - self.stanza = stanza self.url_handlers = {'global': self._default_handler, 'jid': {}} @@ -60,9 +62,6 @@ class xep_0066(base_plugin): StanzaPath('iq@type=set/oob_transfer'), self._handle_transfer)) - def post_init(self): - """Handle cross-plugin dependencies.""" - base_plugin.post_init(self) self.xmpp['xep_0030'].add_feature(stanza.OOBTransfer.namespace) self.xmpp['xep_0030'].add_feature(stanza.OOB.namespace) |