diff --git a/celery/backends/base.py b/celery/backends/base.py index 3e975ed4b..9dd1a4c45 100644 --- a/celery/backends/base.py +++ b/celery/backends/base.py @@ -127,9 +127,6 @@ class BaseBackend(object): "get_taskset is not supported by this backend.") - - - class KeyValueStoreBackend(BaseBackend): capabilities = ["ResultStore"] diff --git a/celery/messaging.py b/celery/messaging.py index d57a91c98..88270873e 100644 --- a/celery/messaging.py +++ b/celery/messaging.py @@ -5,7 +5,7 @@ Sending and Receiving Messages """ import socket -from carrot.connection import DjangoBrokerConnection, AMQPConnectionException +from carrot.connection import DjangoBrokerConnection from carrot.messaging import Publisher, Consumer, ConsumerSet from billiard.utils.functional import wraps diff --git a/celery/task/http.py b/celery/task/http.py index a66f5020b..9f49d0aef 100644 --- a/celery/task/http.py +++ b/celery/task/http.py @@ -7,8 +7,7 @@ except ImportError: from urllib import urlencode from urlparse import urlparse -from anyjson import serialize, deserialize -from billiard.utils.functional import wraps +from anyjson import deserialize from celery import __version__ as celery_version from celery.task.base import Task as BaseTask @@ -64,7 +63,6 @@ class MutableURL(object): self.url = urlparse(url) self._query = dict(parse_qsl(self.url.query)) - def __str__(self): u = self.url query = urlencode(utf8dict(self.query.items())) @@ -208,5 +206,3 @@ class URL(MutableURL): def post_async(self, **kwargs): return self.dispatcher.delay(str(self), "POST", **kwargs) - - diff --git a/celery/tests/test_models.py b/celery/tests/test_models.py index e30ee6c76..f871f9868 100644 --- a/celery/tests/test_models.py +++ b/celery/tests/test_models.py @@ -53,7 +53,8 @@ class TestModels(unittest.TestCase): self.assertTrue(m1.taskset_id) self.assertTrue(isinstance(m1.date_done, datetime)) - self.assertEquals(TaskSetMeta.objects.get_taskset(m1.taskset_id).taskset_id, + self.assertEquals( + TaskSetMeta.objects.get_taskset(m1.taskset_id).taskset_id, m1.taskset_id) # Have to avoid save() because it applies the auto_now=True. diff --git a/celery/views.py b/celery/views.py index 87e35524f..0ec7cf575 100644 --- a/celery/views.py +++ b/celery/views.py @@ -27,7 +27,8 @@ def task_view(task): result = task.apply_async(kwargs=kwargs) response_data = {"ok": "true", "task_id": result.task_id} - return HttpResponse(JSON_dump(response_data), mimetype="application/json") + return HttpResponse(JSON_dump(response_data), + mimetype="application/json") return _applier diff --git a/celery/worker/listener.py b/celery/worker/listener.py index 8d2c24a6f..fd7e6da65 100644 --- a/celery/worker/listener.py +++ b/celery/worker/listener.py @@ -3,6 +3,7 @@ import warnings from datetime import datetime from dateutil.parser import parse as parse_iso8601 +from carrot.connection import AMQPConnectionException from celery import conf from celery import signals @@ -12,7 +13,7 @@ from celery.worker.revoke import revoked from celery.worker.control import ControlDispatch from celery.worker.heartbeat import Heart from celery.events import EventDispatcher -from celery.messaging import establish_connection, AMQPConnectionException +from celery.messaging import establish_connection from celery.messaging import get_consumer_set, BroadcastConsumer from celery.exceptions import NotRegistered from celery.datastructures import SharedCounter diff --git a/examples/celery_http_gateway/manage.py b/examples/celery_http_gateway/manage.py index 5e78ea979..f1ce5399e 100644 --- a/examples/celery_http_gateway/manage.py +++ b/examples/celery_http_gateway/manage.py @@ -4,7 +4,9 @@ try: import settings # Assumed to be in the same directory. except ImportError: import sys - sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) + sys.stderr.write( + "Error: Can't find the file 'settings.py' in the directory \ + containing %r." % __file__) sys.exit(1) if __name__ == "__main__": diff --git a/examples/celery_http_gateway/settings.py b/examples/celery_http_gateway/settings.py index 169e80e05..3c3b592c9 100644 --- a/examples/celery_http_gateway/settings.py +++ b/examples/celery_http_gateway/settings.py @@ -16,12 +16,23 @@ ADMINS = ( MANAGERS = ADMINS -DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. -DATABASE_NAME = 'development.db' # Or path to database file if using sqlite3. -DATABASE_USER = '' # Not used with sqlite3. -DATABASE_PASSWORD = '' # Not used with sqlite3. -DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. -DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. +# 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. +DATABASE_ENGINE = 'sqlite3' + +# path to database file if using sqlite3. +DATABASE_NAME = 'development.db' + +# Not used with sqlite3. +DATABASE_USER = '' + +# Not used with sqlite3. +DATABASE_PASSWORD = '' + +# Set to empty string for localhost. Not used with sqlite3. +DATABASE_HOST = '' + +# Set to empty string for default. Not used with sqlite3. +DATABASE_PORT = '' # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name @@ -73,7 +84,8 @@ MIDDLEWARE_CLASSES = ( ROOT_URLCONF = 'celery_http_gateway.urls' TEMPLATE_DIRS = ( - # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Put strings here, like "/home/html/django_templates" or + # "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. ) diff --git a/examples/httpexample/manage.py b/examples/httpexample/manage.py index 5e78ea979..f1ce5399e 100644 --- a/examples/httpexample/manage.py +++ b/examples/httpexample/manage.py @@ -4,7 +4,9 @@ try: import settings # Assumed to be in the same directory. except ImportError: import sys - sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) + sys.stderr.write( + "Error: Can't find the file 'settings.py' in the directory \ + containing %r." % __file__) sys.exit(1) if __name__ == "__main__": diff --git a/examples/httpexample/settings.py b/examples/httpexample/settings.py index 2efd2b70a..19b74e5ea 100644 --- a/examples/httpexample/settings.py +++ b/examples/httpexample/settings.py @@ -8,13 +8,23 @@ ADMINS = ( ) MANAGERS = ADMINS +# 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. +DATABASE_ENGINE = '' -DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. -DATABASE_NAME = '' # Or path to database file if using sqlite3. -DATABASE_USER = '' # Not used with sqlite3. -DATABASE_PASSWORD = '' # Not used with sqlite3. -DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. -DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. +# Pth to database file if using sqlite3. +DATABASE_NAME = '' + +# Not used with sqlite3. +DATABASE_USER = '' + +# Not used with sqlite3. +DATABASE_PASSWORD = '' + +# Set to empty string for localhost. Not used with sqlite3. +DATABASE_HOST = '' + +# Set to empty string for default. Not used with sqlite3. +DATABASE_PORT = '' # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name @@ -66,7 +76,8 @@ MIDDLEWARE_CLASSES = ( ROOT_URLCONF = 'httpexample.urls' TEMPLATE_DIRS = ( - # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Put strings here, like "/home/html/django_templates" or + # "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. )