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:
parent
0c63a4bbda
commit
46a90749f8
@ -70,7 +70,7 @@ as well.
|
|||||||
class EchoBot(slixmpp.ClientXMPP):
|
class EchoBot(slixmpp.ClientXMPP):
|
||||||
|
|
||||||
def __init__(self, jid, password):
|
def __init__(self, jid, password):
|
||||||
super(EchoBot, self).__init__(jid, password)
|
super().__init__(jid, password)
|
||||||
|
|
||||||
Handling Session Start
|
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
|
.. code-block:: python
|
||||||
|
|
||||||
def __init__(self, jid, password):
|
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('session_start', self.start)
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ whenever a messsage is received.
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
def __init__(self, jid, password):
|
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('session_start', self.start)
|
||||||
self.add_event_handler('message', self.message)
|
self.add_event_handler('message', self.message)
|
||||||
|
@ -24,7 +24,7 @@ for the JID that will receive our message, and the string content of the message
|
|||||||
class SendMsgBot(slixmpp.ClientXMPP):
|
class SendMsgBot(slixmpp.ClientXMPP):
|
||||||
|
|
||||||
def __init__(self, jid, password, recipient, msg):
|
def __init__(self, jid, password, recipient, msg):
|
||||||
super(SendMsgBot, self).__init__(jid, password)
|
super().__init__(jid, password)
|
||||||
|
|
||||||
self.recipient = recipient
|
self.recipient = recipient
|
||||||
self.msg = msg
|
self.msg = msg
|
||||||
|
@ -15,7 +15,7 @@ class PubsubClient(slixmpp.ClientXMPP):
|
|||||||
|
|
||||||
def __init__(self, jid, password, server,
|
def __init__(self, jid, password, server,
|
||||||
node=None, action='nodes', data=''):
|
node=None, action='nodes', data=''):
|
||||||
super(PubsubClient, self).__init__(jid, password)
|
super().__init__(jid, password)
|
||||||
|
|
||||||
self.register_plugin('xep_0030')
|
self.register_plugin('xep_0030')
|
||||||
self.register_plugin('xep_0059')
|
self.register_plugin('xep_0059')
|
||||||
|
@ -14,7 +14,7 @@ from slixmpp.xmlstream.handler import Callback
|
|||||||
class PubsubEvents(slixmpp.ClientXMPP):
|
class PubsubEvents(slixmpp.ClientXMPP):
|
||||||
|
|
||||||
def __init__(self, jid, password):
|
def __init__(self, jid, password):
|
||||||
super(PubsubEvents, self).__init__(jid, password)
|
super().__init__(jid, password)
|
||||||
|
|
||||||
self.register_plugin('xep_0030')
|
self.register_plugin('xep_0030')
|
||||||
self.register_plugin('xep_0059')
|
self.register_plugin('xep_0059')
|
||||||
|
@ -22,7 +22,7 @@ from slixmpp import ClientXMPP
|
|||||||
class LocationBot(ClientXMPP):
|
class LocationBot(ClientXMPP):
|
||||||
|
|
||||||
def __init__(self, jid, password):
|
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('session_start', self.start)
|
||||||
self.add_event_handler('user_location_publish',
|
self.add_event_handler('user_location_publish',
|
||||||
|
@ -17,7 +17,7 @@ from slixmpp import ClientXMPP
|
|||||||
class TuneBot(ClientXMPP):
|
class TuneBot(ClientXMPP):
|
||||||
|
|
||||||
def __init__(self, jid, password):
|
def __init__(self, jid, password):
|
||||||
super(TuneBot, self).__init__(jid, password)
|
super().__init__(jid, password)
|
||||||
|
|
||||||
# Check for the current song every 5 seconds.
|
# Check for the current song every 5 seconds.
|
||||||
self.schedule('Check Current Tune', 5, self._update_tune, repeat=True)
|
self.schedule('Check Current Tune', 5, self._update_tune, repeat=True)
|
||||||
|
@ -77,7 +77,7 @@ class IqTimeout(XMPPError):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, iq):
|
def __init__(self, iq):
|
||||||
super(IqTimeout, self).__init__(
|
super().__init__(
|
||||||
condition='remote-server-timeout',
|
condition='remote-server-timeout',
|
||||||
etype='cancel')
|
etype='cancel')
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ class IqError(XMPPError):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, iq):
|
def __init__(self, iq):
|
||||||
super(IqError, self).__init__(
|
super().__init__(
|
||||||
condition=iq['error']['condition'],
|
condition=iq['error']['condition'],
|
||||||
text=iq['error']['text'],
|
text=iq['error']['text'],
|
||||||
etype=iq['error']['type'])
|
etype=iq['error']['type'])
|
||||||
|
@ -308,7 +308,7 @@ class BasePlugin(object):
|
|||||||
if key in self.default_config:
|
if key in self.default_config:
|
||||||
self.config[key] = value
|
self.config[key] = value
|
||||||
else:
|
else:
|
||||||
super(BasePlugin, self).__setattr__(key, value)
|
super().__setattr__(key, value)
|
||||||
|
|
||||||
def _init(self):
|
def _init(self):
|
||||||
"""Initialize plugin state, such as registering event handlers.
|
"""Initialize plugin state, such as registering event handlers.
|
||||||
|
@ -127,7 +127,7 @@ class Telephone(ElementBase):
|
|||||||
'ISDN', 'PCS', 'PREF'])
|
'ISDN', 'PCS', 'PREF'])
|
||||||
|
|
||||||
def setup(self, xml=None):
|
def setup(self, xml=None):
|
||||||
super(Telephone, self).setup(xml=xml)
|
super().setup(xml=xml)
|
||||||
## this blanks out numbers received from server
|
## this blanks out numbers received from server
|
||||||
##self._set_sub_text('NUMBER', '', keep=True)
|
##self._set_sub_text('NUMBER', '', keep=True)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user