Various PEP8 fixes.

main
Vincent Driessen 10 years ago
parent fac2b10309
commit b8d425b318

@ -253,7 +253,6 @@ class Queue(object):
If Queue is instantiated with async=False, job is executed immediately. If Queue is instantiated with async=False, job is executed immediately.
""" """
with self.connection._pipeline() as pipeline: with self.connection._pipeline() as pipeline:
# Add Queue key set # Add Queue key set
self.connection.sadd(self.redis_queues_keys, self.key) self.connection.sadd(self.redis_queues_keys, self.key)

@ -15,4 +15,4 @@ def suspend(connection, ttl=None):
def resume(connection): def resume(connection):
return connection.delete(WORKERS_SUSPENDED) return connection.delete(WORKERS_SUSPENDED)

@ -217,4 +217,4 @@ def enum(name, *sequential, **named):
# On Python 2 type() requires a byte string (which is str() on Python 2). # On Python 2 type() requires a byte string (which is str() on Python 2).
# On Python 3 it does not matter, so we'll use str(), which acts as # On Python 3 it does not matter, so we'll use str(), which acts as
# a no-op. # a no-op.
return type(str(name), (), values) return type(str(name), (), values)

@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function, from __future__ import (absolute_import, division, print_function,
unicode_literals) unicode_literals)
VERSION = '0.5.0' VERSION = '0.5.0'

@ -12,7 +12,6 @@ import sys
import time import time
import traceback import traceback
import warnings import warnings
from datetime import datetime
from rq.compat import as_text, string_types, text_type from rq.compat import as_text, string_types, text_type
@ -54,8 +53,8 @@ def compact(l):
return [x for x in l if x is not None] return [x for x in l if x is not None]
_signames = dict((getattr(signal, signame), signame) _signames = dict((getattr(signal, signame), signame)
for signame in dir(signal) for signame in dir(signal)
if signame.startswith('SIG') and '_' not in signame) if signame.startswith('SIG') and '_' not in signame)
def signal_name(signum): def signal_name(signum):
@ -367,7 +366,6 @@ class Worker(object):
if before_state: if before_state:
self.set_state(before_state) self.set_state(before_state)
def work(self, burst=False): def work(self, burst=False):
"""Starts the work loop. """Starts the work loop.
@ -416,7 +414,6 @@ class Worker(object):
self.register_death() self.register_death()
return did_perform_work return did_perform_work
def dequeue_job_and_maintain_ttl(self, timeout): def dequeue_job_and_maintain_ttl(self, timeout):
result = None result = None
qnames = self.queue_names() qnames = self.queue_names()

@ -101,9 +101,3 @@ class TestRQCli(RQTestCase):
self.assertEqual(result.exit_code, 1) self.assertEqual(result.exit_code, 1)
self.assertIn("Duration must be an integer greater than 1", result.output) self.assertIn("Duration must be an integer greater than 1", result.output)

@ -339,7 +339,7 @@ class TestJob(RQTestCase):
job = Job.create(func=say_hello, origin=origin) job = Job.create(func=say_hello, origin=origin)
job._dependency_id = 'id' job._dependency_id = 'id'
job.save() job.save()
self.assertEqual(registry.get_job_ids(), []) self.assertEqual(registry.get_job_ids(), [])
job.register_dependency() job.register_dependency()
self.assertEqual(as_text(self.testconn.spop('rq:job:id:dependents')), job.id) self.assertEqual(as_text(self.testconn.spop('rq:job:id:dependents')), job.id)

@ -340,7 +340,7 @@ class TestQueue(RQTestCase):
self.assertFalse(self.testconn.exists(parent_job.dependents_key)) self.assertFalse(self.testconn.exists(parent_job.dependents_key))
# DeferredJobRegistry should also be empty # DeferredJobRegistry should also be empty
self.assertEqual(registry.get_job_ids(), []) self.assertEqual(registry.get_job_ids(), [])
def test_enqueue_job_with_dependency(self): def test_enqueue_job_with_dependency(self):
"""Jobs are enqueued only when their dependencies are finished.""" """Jobs are enqueued only when their dependencies are finished."""

@ -334,7 +334,7 @@ class TestWorker(RQTestCase):
raise raise
q = Queue() q = Queue()
job = q.enqueue(create_file, SENTINEL_FILE) q.enqueue(create_file, SENTINEL_FILE)
w = Worker([q]) w = Worker([q])

Loading…
Cancel
Save