[cleanup] Remove python2 artifacts

This commit is contained in:
Bastien Vallet
2020-06-10 11:33:39 +02:00
parent 142af91fbe
commit 68d95a2924
10 changed files with 15 additions and 21 deletions

View File

@@ -5,7 +5,7 @@ from django.core.cache import caches, InvalidCacheBackendError
from django_q.conf import Conf
class Broker(object):
class Broker:
def __init__(self, list_key=Conf.PREFIX):
self.connection = self.get_connection(list_key)
self.list_key = list_key

View File

@@ -1,9 +1,3 @@
# Future
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import ast
# Standard
@@ -36,7 +30,7 @@ from django_q.signing import SignedPackage, BadSignature
from django_q.status import Stat, Status
class Cluster(object):
class Cluster:
def __init__(self, broker=None):
self.broker = broker or get_broker()
self.sentinel = None
@@ -120,7 +114,7 @@ class Cluster(object):
return self.start_event is None and self.stop_event is None and self.sentinel
class Sentinel(object):
class Sentinel:
def __init__(
self,
stop_event,

View File

@@ -22,7 +22,7 @@ except ImportError:
psutil = None
class Conf(object):
class Conf:
"""
Configuration class
"""
@@ -195,7 +195,7 @@ if not logger.handlers:
# Error Reporting Interface
class ErrorReporter(object):
class ErrorReporter:
# initialize with iterator of reporters (better name, targets?)
def __init__(self, reporters):

View File

@@ -50,7 +50,7 @@ DEFAULT_WORDLIST = (
'zulu')
class HumanHasher(object):
class HumanHasher:
"""
Transforms hex digests to human-readable strings.

View File

@@ -7,7 +7,7 @@ import multiprocessing
import multiprocessing.queues
class SharedCounter(object):
class SharedCounter:
""" A synchronized shared counter.
The locking done by multiprocessing.Value ensures that only a single

View File

@@ -11,7 +11,7 @@ from django_q.conf import Conf
BadSignature = signing.BadSignature
class SignedPackage(object):
class SignedPackage:
"""Wraps Django's signing module with custom Pickle serializer."""
@@ -31,7 +31,7 @@ class SignedPackage(object):
serializer=PickleSerializer)
class PickleSerializer(object):
class PickleSerializer:
"""Simple wrapper around Pickle for signing.dumps and signing.loads."""

View File

@@ -5,7 +5,7 @@ from django_q.conf import Conf, logger
from django_q.signing import SignedPackage, BadSignature
class Status(object):
class Status:
"""Cluster status base class."""
def __init__(self, pid, cluster_id):

View File

@@ -480,7 +480,7 @@ def async_chain(chain, group=None, cached=Conf.CACHED, sync=Conf.SYNC, broker=No
return group
class Iter(object):
class Iter:
"""
An async task with iterable arguments
"""
@@ -550,7 +550,7 @@ class Iter(object):
return len(self.args)
class Chain(object):
class Chain:
"""
A sequential chain of tasks
"""
@@ -634,7 +634,7 @@ class Chain(object):
return len(self.chain)
class AsyncTask(object):
class AsyncTask:
"""
an async task
"""

View File

@@ -22,7 +22,7 @@ from django_q.tests.tasks import multiply, TaskError
from django_q.queues import Queue
class WordClass(object):
class WordClass:
def __init__(self):
self.word_list = DEFAULT_WORDLIST

View File

@@ -3384,7 +3384,7 @@ import sys
import base64
import zlib
class DictImporter(object):
class DictImporter:
def __init__(self, sources):
self.sources = sources