mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-15 13:37:56 +08:00
[cleanup] Remove python2 artifacts
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -50,7 +50,7 @@ DEFAULT_WORDLIST = (
|
||||
'zulu')
|
||||
|
||||
|
||||
class HumanHasher(object):
|
||||
class HumanHasher:
|
||||
|
||||
"""
|
||||
Transforms hex digests to human-readable strings.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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."""
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
"""
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -3384,7 +3384,7 @@ import sys
|
||||
import base64
|
||||
import zlib
|
||||
|
||||
class DictImporter(object):
|
||||
class DictImporter:
|
||||
def __init__(self, sources):
|
||||
self.sources = sources
|
||||
|
||||
|
||||
Reference in New Issue
Block a user