diff --git a/src/socketio/asyncio_pubsub_manager.py b/src/socketio/asyncio_pubsub_manager.py index b6c1a150..ab0a93a1 100644 --- a/src/socketio/asyncio_pubsub_manager.py +++ b/src/socketio/asyncio_pubsub_manager.py @@ -83,7 +83,7 @@ async def can_disconnect(self, sid, namespace): async def disconnect(self, sid, namespace, **kwargs): if kwargs.get('ignore_queue'): - return await super(AsyncPubSubManager, self).disconnect( + return await super().disconnect( sid, namespace=namespace) message = {'method': 'disconnect', 'sid': sid, 'namespace': namespace or '/', 'host_id': self.host_id} diff --git a/src/socketio/kafka_manager.py b/src/socketio/kafka_manager.py index 739871a3..4d87d46f 100644 --- a/src/socketio/kafka_manager.py +++ b/src/socketio/kafka_manager.py @@ -43,8 +43,7 @@ def __init__(self, url='kafka://localhost:9092', channel='socketio', '(Run "pip install kafka-python" in your ' 'virtualenv).') - super(KafkaManager, self).__init__(channel=channel, - write_only=write_only) + super().__init__(channel=channel, write_only=write_only) urls = [url] if isinstance(url, str) else url self.kafka_urls = [url[8:] if url != 'kafka://' else 'localhost:9092' diff --git a/src/socketio/kombu_manager.py b/src/socketio/kombu_manager.py index 7350c156..0a63bc26 100644 --- a/src/socketio/kombu_manager.py +++ b/src/socketio/kombu_manager.py @@ -54,9 +54,7 @@ def __init__(self, url='amqp://guest:guest@localhost:5672//', raise RuntimeError('Kombu package is not installed ' '(Run "pip install kombu" in your ' 'virtualenv).') - super(KombuManager, self).__init__(channel=channel, - write_only=write_only, - logger=logger) + super().__init__(channel=channel, write_only=write_only, logger=logger) self.url = url self.connection_options = connection_options or {} self.exchange_options = exchange_options or {} @@ -65,7 +63,7 @@ def __init__(self, url='amqp://guest:guest@localhost:5672//', self.publisher_connection = self._connection() def initialize(self): - super(KombuManager, self).initialize() + super().initialize() monkey_patched = True if self.server.async_mode == 'eventlet': diff --git a/src/socketio/middleware.py b/src/socketio/middleware.py index 1a697408..acc8ffd3 100644 --- a/src/socketio/middleware.py +++ b/src/socketio/middleware.py @@ -29,14 +29,12 @@ class WSGIApp(engineio.WSGIApp): """ def __init__(self, socketio_app, wsgi_app=None, static_files=None, socketio_path='socket.io'): - super(WSGIApp, self).__init__(socketio_app, wsgi_app, - static_files=static_files, - engineio_path=socketio_path) + super().__init__(socketio_app, wsgi_app, static_files=static_files, + engineio_path=socketio_path) class Middleware(WSGIApp): """This class has been renamed to WSGIApp and is now deprecated.""" def __init__(self, socketio_app, wsgi_app=None, socketio_path='socket.io'): - super(Middleware, self).__init__(socketio_app, wsgi_app, - socketio_path=socketio_path) + super().__init__(socketio_app, wsgi_app, socketio_path=socketio_path) diff --git a/src/socketio/namespace.py b/src/socketio/namespace.py index c0fddd14..5088cd55 100644 --- a/src/socketio/namespace.py +++ b/src/socketio/namespace.py @@ -31,7 +31,7 @@ class Namespace(BaseNamespace): omitted, the default namespace is used. """ def __init__(self, namespace=None): - super(Namespace, self).__init__(namespace=namespace) + super().__init__(namespace=namespace) self.server = None def _set_server(self, server): @@ -166,7 +166,7 @@ class ClientNamespace(BaseNamespace): omitted, the default namespace is used. """ def __init__(self, namespace=None): - super(ClientNamespace, self).__init__(namespace=namespace) + super().__init__(namespace=namespace) self.client = None def _set_client(self, client): diff --git a/src/socketio/pubsub_manager.py b/src/socketio/pubsub_manager.py index 788f0a48..fa5eba4d 100644 --- a/src/socketio/pubsub_manager.py +++ b/src/socketio/pubsub_manager.py @@ -24,14 +24,14 @@ class PubSubManager(BaseManager): name = 'pubsub' def __init__(self, channel='socketio', write_only=False, logger=None): - super(PubSubManager, self).__init__() + super().__init__() self.channel = channel self.write_only = write_only self.host_id = uuid.uuid4().hex self.logger = logger def initialize(self): - super(PubSubManager, self).initialize() + super().initialize() if not self.write_only: self.thread = self.server.start_background_task(self._thread) self._get_logger().info(self.name + ' backend initialized.') @@ -47,7 +47,7 @@ def emit(self, event, data, namespace=None, room=None, skip_sid=None, The parameters are the same as in :meth:`.Server.emit`. """ if kwargs.get('ignore_queue'): - return super(PubSubManager, self).emit( + return super().emit( event, data, namespace=namespace, room=room, skip_sid=skip_sid, callback=callback) namespace = namespace or '/' @@ -81,8 +81,7 @@ def can_disconnect(self, sid, namespace): def disconnect(self, sid, namespace=None, **kwargs): if kwargs.get('ignore_queue'): - return super(PubSubManager, self).disconnect( - sid, namespace=namespace) + return super().disconnect(sid, namespace=namespace) message = {'method': 'disconnect', 'sid': sid, 'namespace': namespace or '/', 'host_id': self.host_id} self._handle_disconnect(message) # handle in this host diff --git a/src/socketio/redis_manager.py b/src/socketio/redis_manager.py index ab40739e..ae9fa292 100644 --- a/src/socketio/redis_manager.py +++ b/src/socketio/redis_manager.py @@ -48,12 +48,10 @@ def __init__(self, url='redis://localhost:6379/0', channel='socketio', self.redis_url = url self.redis_options = redis_options or {} self._redis_connect() - super(RedisManager, self).__init__(channel=channel, - write_only=write_only, - logger=logger) + super().__init__(channel=channel, write_only=write_only, logger=logger) def initialize(self): - super(RedisManager, self).initialize() + super().initialize() monkey_patched = True if self.server.async_mode == 'eventlet': diff --git a/src/socketio/zmq_manager.py b/src/socketio/zmq_manager.py index ec360607..760fbc38 100644 --- a/src/socketio/zmq_manager.py +++ b/src/socketio/zmq_manager.py @@ -72,9 +72,7 @@ def __init__(self, url='zmq+tcp://localhost:5555+5556', self.sink = sink self.sub = sub self.channel = channel - super(ZmqManager, self).__init__(channel=channel, - write_only=write_only, - logger=logger) + super().__init__(channel=channel, write_only=write_only, logger=logger) def _publish(self, data): pickled_data = pickle.dumps(