Various XEPs: Remove deprecated aliases.

This commit is contained in:
Emmanuel Gil Peyrot 2016-09-20 15:58:29 +09:00
parent d099e353a4
commit 7cd1cf32ae
38 changed files with 34 additions and 158 deletions

View file

@ -61,7 +61,7 @@ operation using these stanzas without doing any complex operations such as
checking an ACL, etc.
You may find it necessary at some point to revert a particular node or JID to
using the default, static handlers. To do so, use the method ``make_static()``.
using the default, static handlers. To do so, use the method ``restore_defaults()``.
You may also elect to only convert a given set of actions instead.
Creating a Node Handler

View file

@ -68,7 +68,7 @@ class CommandBot(slixmpp.ClientXMPP):
session. Additional, custom data may be saved
here to persist across handler callbacks.
"""
form = self['xep_0004'].makeForm('form', 'Greeting')
form = self['xep_0004'].make_form('form', 'Greeting')
form['instructions'] = 'Send a custom greeting to a JID'
form.addField(var='greeting',
ftype='text-single',

View file

@ -94,7 +94,7 @@ class CommandUserBot(slixmpp.ClientXMPP):
# label="Your greeting" />
# </x>
form = self['xep_0004'].makeForm(ftype='submit')
form = self['xep_0004'].make_form(ftype='submit')
form.addField(var='greeting',
value=session['greeting'])

View file

@ -13,7 +13,3 @@ from slixmpp.features.feature_bind.stanza import Bind
register_plugin(FeatureBind)
# Retain some backwards compatibility
feature_bind = FeatureBind

View file

@ -16,7 +16,3 @@ from slixmpp.features.feature_mechanisms.stanza import Failure
register_plugin(FeatureMechanisms)
# Retain some backwards compatibility
feature_mechanisms = FeatureMechanisms

View file

@ -13,7 +13,3 @@ from slixmpp.features.feature_rosterver.stanza import RosterVer
register_plugin(FeatureRosterVer)
# Retain some backwards compatibility
feature_rosterver = FeatureRosterVer

View file

@ -13,7 +13,3 @@ from slixmpp.features.feature_session.stanza import Session
register_plugin(FeatureSession)
# Retain some backwards compatibility
feature_session = FeatureSession

View file

@ -13,7 +13,3 @@ from slixmpp.features.feature_starttls.stanza import *
register_plugin(FeatureSTARTTLS)
# Retain some backwards compatibility
feature_starttls = FeatureSTARTTLS

View file

@ -14,9 +14,3 @@ from slixmpp.plugins.xep_0004.dataforms import XEP_0004
register_plugin(XEP_0004)
# Retain some backwards compatibility
xep_0004 = XEP_0004
xep_0004.makeForm = xep_0004.make_form
xep_0004.buildForm = xep_0004.build_form

View file

@ -14,7 +14,3 @@ from slixmpp.plugins.xep_0009.stanza import RPCQuery, MethodCall, MethodResponse
register_plugin(XEP_0009)
# Retain some backwards compatibility
xep_0009 = XEP_0009

View file

@ -13,7 +13,3 @@ from slixmpp.plugins.xep_0012.last_activity import XEP_0012
register_plugin(XEP_0012)
# Retain some backwards compatibility
xep_0004 = XEP_0012

View file

@ -15,8 +15,3 @@ from slixmpp.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.make_static = XEP_0030.restore_defaults

View file

@ -14,7 +14,3 @@ from slixmpp.plugins.xep_0033.addresses import XEP_0033
register_plugin(XEP_0033)
# Retain some backwards compatibility
xep_0033 = XEP_0033
Addresses.addAddress = Addresses.add_address

View file

@ -118,14 +118,8 @@ for atype in ('all', 'bcc', 'cc', 'noreply', 'replyroom', 'replyto', 'to'):
setattr(Addresses, "del_%s" % atype, del_multi)
# To retain backwards compatibility:
setattr(Addresses, "get%s" % atype.title(), get_multi)
setattr(Addresses, "set%s" % atype.title(), set_multi)
setattr(Addresses, "del%s" % atype.title(), del_multi)
if atype == 'all':
Addresses.interfaces.add('addresses')
setattr(Addresses, "getAddresses", get_multi)
setattr(Addresses, "setAddresses", set_multi)
setattr(Addresses, "delAddresses", del_multi)
register_stanza_plugin(Addresses, Address, iterable=True)

View file

@ -360,7 +360,7 @@ class XEP_0045(BasePlugin):
form = result.xml.find('{http://jabber.org/protocol/muc#owner}query/{jabber:x:data}x')
if form is None:
raise ValueError
return self.xmpp.plugin['xep_0004'].buildForm(form)
return self.xmpp.plugin['xep_0004'].build_form(form)
def cancelConfig(self, room, ifrom=None):
query = ET.Element('{http://jabber.org/protocol/muc#owner}query')

View file

@ -15,7 +15,3 @@ from slixmpp.plugins.xep_0047.ibb import XEP_0047
register_plugin(XEP_0047)
# Retain some backwards compatibility
xep_0047 = XEP_0047

View file

@ -13,7 +13,3 @@ from slixmpp.plugins.xep_0050.adhoc import XEP_0050
register_plugin(XEP_0050)
# Retain some backwards compatibility
xep_0050 = XEP_0050

View file

@ -13,6 +13,3 @@ from slixmpp.plugins.xep_0059.rsm import ResultIterator, XEP_0059
register_plugin(XEP_0059)
# Retain some backwards compatibility
xep_0059 = XEP_0059

View file

@ -13,7 +13,3 @@ from slixmpp.plugins.xep_0060 import stanza
register_plugin(XEP_0060)
# Retain some backwards compatibility
xep_0060 = XEP_0060

View file

@ -14,7 +14,3 @@ from slixmpp.plugins.xep_0066.oob import XEP_0066
register_plugin(XEP_0066)
# Retain some backwards compatibility
xep_0066 = XEP_0066

View file

@ -13,7 +13,3 @@ from slixmpp.plugins.xep_0077.register import XEP_0077
register_plugin(XEP_0077)
# Retain some backwards compatibility
xep_0077 = XEP_0077

View file

@ -14,7 +14,3 @@ from slixmpp.plugins.xep_0078.legacyauth import XEP_0078
register_plugin(XEP_0078)
# Retain some backwards compatibility
xep_0078 = XEP_0078

View file

@ -13,7 +13,3 @@ from slixmpp.plugins.xep_0085.chat_states import XEP_0085
register_plugin(XEP_0085)
# Retain some backwards compatibility
xep_0085 = XEP_0085

View file

@ -13,7 +13,3 @@ from slixmpp.plugins.xep_0086.legacy_error import XEP_0086
register_plugin(XEP_0086)
# Retain some backwards compatibility
xep_0086 = XEP_0086

View file

@ -14,7 +14,3 @@ from slixmpp.plugins.xep_0092.version import XEP_0092
register_plugin(XEP_0092)
# Retain some backwards compatibility
xep_0092 = XEP_0092

View file

@ -14,7 +14,3 @@ from slixmpp.plugins.xep_0115.caps import XEP_0115
register_plugin(XEP_0115)
# Retain some backwards compatibility
xep_0115 = XEP_0115

View file

@ -5,7 +5,3 @@ from slixmpp.plugins.xep_0122.data_validation import XEP_0122
register_plugin(XEP_0122)
# Retain some backwards compatibility
xep_0122 = XEP_0122

View file

@ -13,7 +13,3 @@ from slixmpp.plugins.xep_0128.extended_disco import XEP_0128
register_plugin(XEP_0128)
# Retain some backwards compatibility
xep_0128 = XEP_0128

View file

@ -13,7 +13,3 @@ from slixmpp.plugins.xep_0184.receipt import XEP_0184
register_plugin(XEP_0184)
# Retain some backwards compatibility
xep_0184 = XEP_0184

View file

@ -13,8 +13,3 @@ from slixmpp.plugins.xep_0199.ping import XEP_0199
register_plugin(XEP_0199)
# Backwards compatibility for names
xep_0199 = XEP_0199
xep_0199.sendPing = xep_0199.send_ping

View file

@ -14,7 +14,3 @@ from slixmpp.plugins.xep_0202.time import XEP_0202
register_plugin(XEP_0202)
# Retain some backwards compatibility
xep_0202 = XEP_0202

View file

@ -14,6 +14,3 @@ from slixmpp.plugins.xep_0203.delay import XEP_0203
register_plugin(XEP_0203)
# Retain some backwards compatibility
xep_0203 = XEP_0203

View file

@ -14,7 +14,3 @@ from slixmpp.plugins.xep_0224.attention import XEP_0224
register_plugin(XEP_0224)
# Retain some backwards compatibility
xep_0224 = XEP_0224

View file

@ -13,7 +13,3 @@ from slixmpp.plugins.xep_0249.invite import XEP_0249
register_plugin(XEP_0249)
# Retain some backwards compatibility
xep_0249 = XEP_0249

View file

@ -13,7 +13,7 @@ class TestAddresses(SlixTest):
def testAddAddress(self):
"""Testing adding extended stanza address."""
msg = self.Message()
msg['addresses'].addAddress(atype='to', jid='to@header1.org')
msg['addresses'].add_address(atype='to', jid='to@header1.org')
self.check(msg, """
<message>
<addresses xmlns="http://jabber.org/protocol/address">
@ -23,9 +23,9 @@ class TestAddresses(SlixTest):
""")
msg = self.Message()
msg['addresses'].addAddress(atype='replyto',
jid='replyto@header1.org',
desc='Reply address')
msg['addresses'].add_address(atype='replyto',
jid='replyto@header1.org',
desc='Reply address')
self.check(msg, """
<message>
<addresses xmlns="http://jabber.org/protocol/address">
@ -48,7 +48,7 @@ class TestAddresses(SlixTest):
"""
msg = self.Message()
msg['addresses'].setAddresses([
msg['addresses'].set_addresses([
{'type':'replyto',
'jid':'replyto@header1.org',
'desc':'Reply address'},
@ -69,9 +69,9 @@ class TestAddresses(SlixTest):
"""Testing adding URI attribute to extended stanza address."""
msg = self.Message()
addr = msg['addresses'].addAddress(atype='to',
jid='to@header1.org',
node='foo')
addr = msg['addresses'].add_address(atype='to',
jid='to@header1.org',
node='foo')
self.check(msg, """
<message>
<addresses xmlns="http://jabber.org/protocol/address">
@ -101,7 +101,7 @@ class TestAddresses(SlixTest):
"""
msg = self.Message()
addr = msg['addresses'].addAddress(jid='to@header1.org', atype='to')
addr = msg['addresses'].add_address(jid='to@header1.org', atype='to')
self.check(msg, xmlstring % '')
addr['delivered'] = True

View file

@ -205,8 +205,8 @@ class TestStreamDisco(SlixTest):
handler=dynamic_jid)
self.xmpp['xep_0030'].make_static(jid='tester@localhost',
node='testing')
self.xmpp['xep_0030'].restore_defaults(jid='tester@localhost',
node='testing')
self.xmpp['xep_0030'].add_identity(jid='tester@localhost',
node='testing',
@ -245,8 +245,8 @@ class TestStreamDisco(SlixTest):
self.xmpp['xep_0030'].set_node_handler('get_info',
handler=dynamic_global)
self.xmpp['xep_0030'].make_static(jid='user@tester.localhost',
node='testing')
self.xmpp['xep_0030'].restore_defaults(jid='user@tester.localhost',
node='testing')
self.xmpp['xep_0030'].add_feature(jid='user@tester.localhost',
node='testing',
@ -396,8 +396,8 @@ class TestStreamDisco(SlixTest):
handler=dynamic_jid)
self.xmpp['xep_0030'].make_static(jid='tester@localhost',
node='testing')
self.xmpp['xep_0030'].restore_defaults(jid='tester@localhost',
node='testing')
self.xmpp['xep_0030'].add_item(ijid='tester@localhost',
node='testing',
@ -436,8 +436,8 @@ class TestStreamDisco(SlixTest):
self.xmpp['xep_0030'].set_node_handler('get_items',
handler=dynamic_global)
self.xmpp['xep_0030'].make_static(jid='user@tester.localhost',
node='testing')
self.xmpp['xep_0030'].restore_defaults(jid='user@tester.localhost',
node='testing')
self.xmpp['xep_0030'].add_item(ijid='user@tester.localhost',
node='testing',

View file

@ -76,7 +76,7 @@ class TestAdHocCommands(SlixTest):
"""Test running a command with no steps."""
def handle_command(iq, session):
form = self.xmpp['xep_0004'].makeForm(ftype='result')
form = self.xmpp['xep_0004'].make_form(ftype='result')
form.addField(var='foo', ftype='text-single',
label='Foo', value='bar')
@ -122,7 +122,7 @@ class TestAdHocCommands(SlixTest):
results.append(form.get_values()['foo'])
session['payload'] = None
form = self.xmpp['xep_0004'].makeForm('form')
form = self.xmpp['xep_0004'].make_form('form')
form.addField(var='foo', ftype='text-single', label='Foo')
session['payload'] = form
@ -198,7 +198,7 @@ class TestAdHocCommands(SlixTest):
def handle_step1(form, session):
results.append(form.get_values()['foo'])
form = self.xmpp['xep_0004'].makeForm('form')
form = self.xmpp['xep_0004'].make_form('form')
form.addField(var='bar', ftype='text-single', label='Bar')
session['payload'] = form
@ -207,7 +207,7 @@ class TestAdHocCommands(SlixTest):
return session
form = self.xmpp['xep_0004'].makeForm('form')
form = self.xmpp['xep_0004'].make_form('form')
form.addField(var='foo', ftype='text-single', label='Foo')
session['payload'] = form
@ -312,7 +312,7 @@ class TestAdHocCommands(SlixTest):
def handle_cancel(iq, session):
results.append('canceled')
form = self.xmpp['xep_0004'].makeForm('form')
form = self.xmpp['xep_0004'].make_form('form')
form.addField(var='foo', ftype='text-single', label='Foo')
session['payload'] = form
@ -380,7 +380,7 @@ class TestAdHocCommands(SlixTest):
"""Test adding notes to commands."""
def handle_command(iq, session):
form = self.xmpp['xep_0004'].makeForm(ftype='result')
form = self.xmpp['xep_0004'].make_form(ftype='result')
form.addField(var='foo', ftype='text-single',
label='Foo', value='bar')
@ -431,11 +431,11 @@ class TestAdHocCommands(SlixTest):
results.append(form.get_values()['FORM_TYPE'])
session['payload'] = None
form1 = self.xmpp['xep_0004'].makeForm('form')
form1 = self.xmpp['xep_0004'].make_form('form')
form1.addField(var='FORM_TYPE', ftype='hidden', value='form_1')
form1.addField(var='foo', ftype='text-single', label='Foo')
form2 = self.xmpp['xep_0004'].makeForm('form')
form2 = self.xmpp['xep_0004'].make_form('form')
form2.addField(var='FORM_TYPE', ftype='hidden', value='form_2')
form2.addField(var='foo', ftype='text-single', label='Foo')
@ -528,7 +528,7 @@ class TestAdHocCommands(SlixTest):
results.append(item)
def handle_step2(iq, session):
form = self.xmpp['xep_0004'].makeForm(ftype='submit')
form = self.xmpp['xep_0004'].make_form(ftype='submit')
form.addField(var='bar', value='123')
session['custom_data'].append('baz')
@ -537,7 +537,7 @@ class TestAdHocCommands(SlixTest):
self.xmpp['xep_0050'].complete_command(session)
def handle_step1(iq, session):
form = self.xmpp['xep_0004'].makeForm(ftype='submit')
form = self.xmpp['xep_0004'].make_form(ftype='submit')
form.addField(var='foo', value='42')
session['custom_data'].append('bar')

View file

@ -18,7 +18,7 @@ class TestStreamExtendedDisco(SlixTest):
'xep_0004',
'xep_0128'])
form = self.xmpp['xep_0004'].makeForm(ftype='result')
form = self.xmpp['xep_0004'].make_form(ftype='result')
form.addField(var='FORM_TYPE', ftype='hidden', value='testing')
info_ns = 'http://jabber.org/protocol/disco#info'
@ -57,10 +57,10 @@ class TestStreamExtendedDisco(SlixTest):
'xep_0004',
'xep_0128'])
form1 = self.xmpp['xep_0004'].makeForm(ftype='result')
form1 = self.xmpp['xep_0004'].make_form(ftype='result')
form1.addField(var='FORM_TYPE', ftype='hidden', value='testing')
form2 = self.xmpp['xep_0004'].makeForm(ftype='result')
form2 = self.xmpp['xep_0004'].make_form(ftype='result')
form2.addField(var='FORM_TYPE', ftype='hidden', value='testing_2')
info_ns = 'http://jabber.org/protocol/disco#info'