diff --git a/queue_job/delay.py b/queue_job/delay.py index e46e95aed..726e85049 100644 --- a/queue_job/delay.py +++ b/queue_job/delay.py @@ -609,7 +609,7 @@ def _execute_direct(self): self._generated_job.perform() -class DelayableRecordset(object): +class DelayableRecordset: """Allow to delay a method for a recordset (shortcut way) Usage:: diff --git a/queue_job/job.py b/queue_job/job.py index 465193963..288b3e042 100644 --- a/queue_job/job.py +++ b/queue_job/job.py @@ -105,7 +105,7 @@ def identity_exact_hasher(job_): @total_ordering -class Job(object): +class Job: """A Job is a task to execute. It is the in-memory representation of a job. Jobs are stored in the ``queue.job`` Odoo Model, but they are handled diff --git a/queue_job/jobrunner/channels.py b/queue_job/jobrunner/channels.py index 6812aa496..468fb5760 100644 --- a/queue_job/jobrunner/channels.py +++ b/queue_job/jobrunner/channels.py @@ -14,7 +14,7 @@ _logger = logging.getLogger(__name__) -class PriorityQueue(object): +class PriorityQueue: """A priority queue that supports removing arbitrary objects. Adding an object already in the queue is a no op. @@ -103,7 +103,7 @@ def pop(self): @total_ordering -class ChannelJob(object): +class ChannelJob: """A channel job is attached to a channel and holds the properties of a job that are necessary to prioritise them. @@ -205,7 +205,7 @@ def __lt__(self, other): return self.sorting_key() < other.sorting_key() -class ChannelQueue(object): +class ChannelQueue: """A channel queue is a priority queue for jobs. Jobs with an eta are set aside until their eta is past due, at @@ -334,7 +334,7 @@ def get_wakeup_time(self, wakeup_time=0): return wakeup_time -class Channel(object): +class Channel: """A channel for jobs, with a maximum capacity. When jobs are created by queue_job modules, they may be associated @@ -581,7 +581,7 @@ def split_strip(s, sep, maxsplit=-1): return [x.strip() for x in s.split(sep, maxsplit)] -class ChannelManager(object): +class ChannelManager: """High level interface for channels This class handles: diff --git a/queue_job/jobrunner/runner.py b/queue_job/jobrunner/runner.py index 25823a997..025c228c6 100644 --- a/queue_job/jobrunner/runner.py +++ b/queue_job/jobrunner/runner.py @@ -259,7 +259,7 @@ def urlopen(): thread.start() -class Database(object): +class Database: def __init__(self, db_name): self.db_name = db_name connection_info = _connection_info_for(db_name) @@ -344,7 +344,7 @@ def set_job_enqueued(self, uuid): ) -class QueueJobRunner(object): +class QueueJobRunner: def __init__( self, scheme="http", diff --git a/test_queue_job/tests/test_job.py b/test_queue_job/tests/test_job.py index 48687450f..4ff3c9233 100644 --- a/test_queue_job/tests/test_job.py +++ b/test_queue_job/tests/test_job.py @@ -89,7 +89,7 @@ def test_infinite_retryable_error(self): self.assertEqual(test_job.retry, 1) def test_on_instance_method(self): - class A(object): + class A: def method(self): pass