PEP8 cleanups, remove unused imports, add missing imports

This commit is contained in:
Roberto Rosario
2012-09-29 01:40:33 -04:00
parent 0f1e01084c
commit e62835fd27
25 changed files with 36 additions and 60 deletions

View File

@@ -38,7 +38,7 @@ class Job(object):
# OR launch 2 processes: monitor & actual process
node = Node.objects.myself()
worker, created = Worker.objects.get_or_create(node=node, pid=os.getpid())
worker.job_queue_item=job_queue_item
worker.job_queue_item = job_queue_item
worker.save()
try:
transaction.commit_on_success(function)(**loads(job_queue_item.kwargs))
@@ -248,7 +248,7 @@ class JobQueueItem(models.Model):
at_top: requeue at the top of the file usually for jobs that
die and shouldn't be placed at the bottom of the queue
"""
if self.is_in_error_state or force==True:
if self.is_in_error_state or force == True:
# TODO: raise exception if not in error state
self.state = JOB_STATE_PENDING
if not at_top:

View File

@@ -5,7 +5,7 @@ urlpatterns = patterns('job_processor.views',
url(r'^node/(?P<node_pk>\d+)/workers/$', 'node_workers', (), 'node_workers'),
url(r'^queue/list/$', 'job_queues', (), 'job_queues'),
url(r'^queue/(?P<job_queue_pk>\d+)/items/pending/$', 'job_queue_items', {'pending_jobs': True}, 'job_queue_items_pending'),
url(r'^queue/(?P<job_queue_pk>\d+)/items/error/$', 'job_queue_items', {'error_jobs' :True}, 'job_queue_items_error'),
url(r'^queue/(?P<job_queue_pk>\d+)/items/error/$', 'job_queue_items', {'error_jobs': True}, 'job_queue_items_error'),
url(r'^queue/(?P<job_queue_pk>\d+)/items/active/$', 'job_queue_items', {'active_jobs' :True}, 'job_queue_items_active'),
url(r'^queue/(?P<job_queue_pk>\d+)/start/$', 'job_queue_start', (), 'job_queue_start'),
url(r'^queue/(?P<job_queue_pk>\d+)/stop/$', 'job_queue_stop', (), 'job_queue_stop'),