Moving backwards compatibility shims to __init__ files.

This commit is contained in:
Lance Stout 2012-03-11 18:40:30 -07:00
parent 8b06d10415
commit e287282782
4 changed files with 22 additions and 17 deletions

View File

@ -6,7 +6,18 @@
See the file LICENSE for copying permission. See the file LICENSE for copying permission.
""" """
from sleekxmpp.plugins.base import register_plugin
from sleekxmpp.plugins.xep_0030 import stanza from sleekxmpp.plugins.xep_0030 import stanza
from sleekxmpp.plugins.xep_0030.stanza import DiscoInfo, DiscoItems from sleekxmpp.plugins.xep_0030.stanza import DiscoInfo, DiscoItems
from sleekxmpp.plugins.xep_0030.static import StaticDisco from sleekxmpp.plugins.xep_0030.static import StaticDisco
from sleekxmpp.plugins.xep_0030.disco import xep_0030 from sleekxmpp.plugins.xep_0030.disco import XEP_0030
register_plugin(XEP_0030)
# Retain some backwards compatibility
xep_0030 = XEP_0030
XEP_0030.getInfo = XEP_0030.get_info
XEP_0030.getItems = XEP_0030.get_items
XEP_0030.make_static = XEP_0030.restore_defaults

View File

@ -11,7 +11,7 @@ import logging
import sleekxmpp import sleekxmpp
from sleekxmpp import Iq from sleekxmpp import Iq
from sleekxmpp.exceptions import XMPPError, IqError, IqTimeout from sleekxmpp.exceptions import XMPPError, IqError, IqTimeout
from sleekxmpp.plugins import BasePlugin, register_plugin from sleekxmpp.plugins import BasePlugin
from sleekxmpp.xmlstream.handler import Callback from sleekxmpp.xmlstream.handler import Callback
from sleekxmpp.xmlstream.matcher import StanzaPath from sleekxmpp.xmlstream.matcher import StanzaPath
from sleekxmpp.xmlstream import register_stanza_plugin, ElementBase, ET, JID from sleekxmpp.xmlstream import register_stanza_plugin, ElementBase, ET, JID
@ -787,12 +787,3 @@ class XEP_0030(BasePlugin):
iq.append(payload) iq.append(payload)
return iq return iq
return payload return payload
register_plugin(XEP_0030)
# Retain some backwards compatibility
xep_0030 = XEP_0030
XEP_0030.getInfo = XEP_0030.get_info
XEP_0030.getItems = XEP_0030.get_items
XEP_0030.make_static = XEP_0030.restore_defaults

View File

@ -6,5 +6,13 @@
See the file LICENSE for copying permission. See the file LICENSE for copying permission.
""" """
from sleekxmpp.plugins.base import register_plugin
from sleekxmpp.plugins.xep_0059.stanza import Set from sleekxmpp.plugins.xep_0059.stanza import Set
from sleekxmpp.plugins.xep_0059.rsm import ResultIterator, xep_0059 from sleekxmpp.plugins.xep_0059.rsm import ResultIterator, XEP_0059
register_plugin(XEP_0059)
# Retain some backwards compatibility
xep_0059 = XEP_0059

View File

@ -129,8 +129,3 @@ class XEP_0059(BasePlugin):
the interface 'disco_items' should be used. the interface 'disco_items' should be used.
""" """
return ResultIterator(stanza, interface) return ResultIterator(stanza, interface)
register_plugin(XEP_0059)
xep_0059 = XEP_0059