Fix uses of super() in the codebase

Fix #3165, we don’t need to use the long form to get the superobject in
our supported python versions.
This commit is contained in:
mathieui 2016-09-30 21:25:36 +02:00
parent 0c63a4bbda
commit 46a90749f8
9 changed files with 12 additions and 12 deletions

View file

@ -70,7 +70,7 @@ as well.
class EchoBot(slixmpp.ClientXMPP):
def __init__(self, jid, password):
super(EchoBot, self).__init__(jid, password)
super().__init__(jid, password)
Handling Session Start
~~~~~~~~~~~~~~~~~~~~~~
@ -83,7 +83,7 @@ started. To do that, we will register an event handler for the :term:`session_st
.. code-block:: python
def __init__(self, jid, password):
super(EchoBot, self).__init__(jid, password)
super().__init__(jid, password)
self.add_event_handler('session_start', self.start)
@ -153,7 +153,7 @@ whenever a messsage is received.
.. code-block:: python
def __init__(self, jid, password):
super(EchoBot, self).__init__(jid, password)
super().__init__(jid, password)
self.add_event_handler('session_start', self.start)
self.add_event_handler('message', self.message)

View file

@ -24,7 +24,7 @@ for the JID that will receive our message, and the string content of the message
class SendMsgBot(slixmpp.ClientXMPP):
def __init__(self, jid, password, recipient, msg):
super(SendMsgBot, self).__init__(jid, password)
super().__init__(jid, password)
self.recipient = recipient
self.msg = msg

View file

@ -15,7 +15,7 @@ class PubsubClient(slixmpp.ClientXMPP):
def __init__(self, jid, password, server,
node=None, action='nodes', data=''):
super(PubsubClient, self).__init__(jid, password)
super().__init__(jid, password)
self.register_plugin('xep_0030')
self.register_plugin('xep_0059')

View file

@ -14,7 +14,7 @@ from slixmpp.xmlstream.handler import Callback
class PubsubEvents(slixmpp.ClientXMPP):
def __init__(self, jid, password):
super(PubsubEvents, self).__init__(jid, password)
super().__init__(jid, password)
self.register_plugin('xep_0030')
self.register_plugin('xep_0059')

View file

@ -22,7 +22,7 @@ from slixmpp import ClientXMPP
class LocationBot(ClientXMPP):
def __init__(self, jid, password):
super(LocationBot, self).__init__(jid, password)
super().__init__(jid, password)
self.add_event_handler('session_start', self.start)
self.add_event_handler('user_location_publish',

View file

@ -17,7 +17,7 @@ from slixmpp import ClientXMPP
class TuneBot(ClientXMPP):
def __init__(self, jid, password):
super(TuneBot, self).__init__(jid, password)
super().__init__(jid, password)
# Check for the current song every 5 seconds.
self.schedule('Check Current Tune', 5, self._update_tune, repeat=True)

View file

@ -77,7 +77,7 @@ class IqTimeout(XMPPError):
"""
def __init__(self, iq):
super(IqTimeout, self).__init__(
super().__init__(
condition='remote-server-timeout',
etype='cancel')
@ -94,7 +94,7 @@ class IqError(XMPPError):
"""
def __init__(self, iq):
super(IqError, self).__init__(
super().__init__(
condition=iq['error']['condition'],
text=iq['error']['text'],
etype=iq['error']['type'])

View file

@ -308,7 +308,7 @@ class BasePlugin(object):
if key in self.default_config:
self.config[key] = value
else:
super(BasePlugin, self).__setattr__(key, value)
super().__setattr__(key, value)
def _init(self):
"""Initialize plugin state, such as registering event handlers.

View file

@ -127,7 +127,7 @@ class Telephone(ElementBase):
'ISDN', 'PCS', 'PREF'])
def setup(self, xml=None):
super(Telephone, self).setup(xml=xml)
super().setup(xml=xml)
## this blanks out numbers received from server
##self._set_sub_text('NUMBER', '', keep=True)