Kaynağa Gözat

Remove extraenous whitespace using pystrip

Ask Solem 16 yıl önce
ebeveyn
işleme
2723ca06da

+ 1 - 1
celery/backends/__init__.py

@@ -47,7 +47,7 @@ get_default_periodicstatus_backend_cls = partial(get_backend_cls,
 
 
 """
 """
 .. class:: DefaultBackend
 .. class:: DefaultBackend
-    
+
     The default backend class used for storing task results and status,
     The default backend class used for storing task results and status,
     specified in :setting:`CELERY_BACKEND`.
     specified in :setting:`CELERY_BACKEND`.
 
 

+ 4 - 4
celery/backends/base.py

@@ -13,7 +13,7 @@ def find_nearest_pickleable_exception(exc):
     not go below :exc:`Exception` (i.e. it skips :exc:`Exception`,
     not go below :exc:`Exception` (i.e. it skips :exc:`Exception`,
     :class:`BaseException` and :class:`object`). If that happens
     :class:`BaseException` and :class:`object`). If that happens
     you should use :exc:`UnpickleableException` instead.
     you should use :exc:`UnpickleableException` instead.
-  
+
     :param exc: An exception instance.
     :param exc: An exception instance.
 
 
     :returns: the nearest exception if it's not :exc:`Exception` or below,
     :returns: the nearest exception if it's not :exc:`Exception` or below,
@@ -39,11 +39,11 @@ def find_nearest_pickleable_exception(exc):
 
 
 class UnpickleableExceptionWrapper(Exception):
 class UnpickleableExceptionWrapper(Exception):
     """Wraps unpickleable exceptions.
     """Wraps unpickleable exceptions.
-   
+
     :param exc_module: see :attr:`exc_module`.
     :param exc_module: see :attr:`exc_module`.
 
 
     :param exc_cls_name: see :attr:`exc_cls_name`.
     :param exc_cls_name: see :attr:`exc_cls_name`.
-    
+
     :param exc_args: see :attr:`exc_args`
     :param exc_args: see :attr:`exc_args`
 
 
     .. attribute:: exc_module
     .. attribute:: exc_module
@@ -116,7 +116,7 @@ class BaseBackend(object):
             return excwrapper
             return excwrapper
         else:
         else:
             return exc
             return exc
-    
+
     def exception_to_python(self, exc):
     def exception_to_python(self, exc):
         if isinstance(exc, UnpickleableExceptionWrapper):
         if isinstance(exc, UnpickleableExceptionWrapper):
             exc_cls = self.create_exception_cls(exc.exc_cls_name,
             exc_cls = self.create_exception_cls(exc.exc_cls_name,

+ 12 - 12
celery/conf.py

@@ -18,7 +18,7 @@ DEFAULT_REAP_TIMEOUT = 30
 
 
 """
 """
 .. data:: LOG_LEVELS
 .. data:: LOG_LEVELS
-   
+
     Mapping of log level names to :mod:`logging` module constants.
     Mapping of log level names to :mod:`logging` module constants.
 
 
 """
 """
@@ -34,7 +34,7 @@ LOG_LEVELS = {
 
 
 """
 """
 .. data:: LOG_FORMAT
 .. data:: LOG_FORMAT
-   
+
     The format to use for log messages.
     The format to use for log messages.
     Default is ``[%(asctime)s: %(levelname)s/%(processName)s] %(message)s``
     Default is ``[%(asctime)s: %(levelname)s/%(processName)s] %(message)s``
 
 
@@ -44,7 +44,7 @@ LOG_FORMAT = getattr(settings, "CELERYD_DAEMON_LOG_FORMAT",
 
 
 """
 """
 .. data:: DAEMON_LOG_FILE
 .. data:: DAEMON_LOG_FILE
-   
+
     The path to the deamon log file (if not set, ``stderr`` is used).
     The path to the deamon log file (if not set, ``stderr`` is used).
 
 
 """
 """
@@ -53,7 +53,7 @@ DAEMON_LOG_FILE = getattr(settings, "CELERYD_LOG_FILE",
 
 
 """
 """
 .. data:: DAEMON_LOG_LEVEL
 .. data:: DAEMON_LOG_LEVEL
-   
+
     Celery daemon log level, can be any of ``DEBUG``, ``INFO``, ``WARNING``,
     Celery daemon log level, can be any of ``DEBUG``, ``INFO``, ``WARNING``,
     ``ERROR``, ``CRITICAL``, or ``FATAL``. See the :mod:`logging` module
     ``ERROR``, ``CRITICAL``, or ``FATAL``. See the :mod:`logging` module
     for more information.
     for more information.
@@ -64,7 +64,7 @@ DAEMON_LOG_LEVEL = LOG_LEVELS[getattr(settings, "CELERYD_DAEMON_LOG_LEVEL",
 
 
 """
 """
 .. data:: QUEUE_WAKEUP_AFTER
 .. data:: QUEUE_WAKEUP_AFTER
-   
+
     The time (in seconds) the celery worker should sleep when there's
     The time (in seconds) the celery worker should sleep when there's
     no messages left on the queue. After the time is slept, the worker
     no messages left on the queue. After the time is slept, the worker
     wakes up and checks the queue again.
     wakes up and checks the queue again.
@@ -75,7 +75,7 @@ QUEUE_WAKEUP_AFTER = getattr(settings, "CELERYD_QUEUE_WAKEUP_AFTER",
 
 
 """
 """
 .. data:: EMPTY_MSG_EMIT_EVERY
 .. data:: EMPTY_MSG_EMIT_EVERY
-   
+
     How often the celery daemon should write a log message saying there are no
     How often the celery daemon should write a log message saying there are no
     messages in the queue. If this is ``None`` or ``0``, it will never print
     messages in the queue. If this is ``None`` or ``0``, it will never print
     this message.
     this message.
@@ -86,7 +86,7 @@ EMPTY_MSG_EMIT_EVERY = getattr(settings, "CELERYD_EMPTY_MSG_EMIT_EVERY",
 
 
 """
 """
 .. data:: DAEMON_PID_FILE
 .. data:: DAEMON_PID_FILE
-   
+
     Full path to the daemon pidfile.
     Full path to the daemon pidfile.
 
 
 """
 """
@@ -95,7 +95,7 @@ DAEMON_PID_FILE = getattr(settings, "CELERYD_PID_FILE",
 
 
 """
 """
 .. data:: DAEMON_CONCURRENCY
 .. data:: DAEMON_CONCURRENCY
-   
+
     The number of concurrent worker processes, executing tasks simultaneously.
     The number of concurrent worker processes, executing tasks simultaneously.
 
 
 """
 """
@@ -116,7 +116,7 @@ AMQP_EXCHANGE = getattr(settings, "CELERY_AMQP_EXCHANGE",
 .. data:: AMQP_EXCHANGE_TYPE
 .. data:: AMQP_EXCHANGE_TYPE
 
 
 The type of exchange. If the exchange type is ``direct``, all messages
 The type of exchange. If the exchange type is ``direct``, all messages
-receives all tasks. However, if the exchange type is ``topic``, you can 
+receives all tasks. However, if the exchange type is ``topic``, you can
 route e.g some tasks to one server, and others to the rest.
 route e.g some tasks to one server, and others to the rest.
 See `Exchange types and the effect of bindings`_.
 See `Exchange types and the effect of bindings`_.
 
 
@@ -128,7 +128,7 @@ AMQP_EXCHANGE_TYPE = getattr(settings, "CELERY_AMQP_EXCHANGE_TYPE",
 
 
 """
 """
 .. data:: AMQP_PUBLISHER_ROUTING_KEY
 .. data:: AMQP_PUBLISHER_ROUTING_KEY
-   
+
     The default AMQP routing key used when publishing tasks.
     The default AMQP routing key used when publishing tasks.
 
 
 """
 """
@@ -138,7 +138,7 @@ AMQP_PUBLISHER_ROUTING_KEY = getattr(settings,
 
 
 """
 """
 .. data:: AMQP_CONSUMER_ROUTING_KEY
 .. data:: AMQP_CONSUMER_ROUTING_KEY
-   
+
     The AMQP routing key used when consuming tasks.
     The AMQP routing key used when consuming tasks.
 
 
 """
 """
@@ -148,7 +148,7 @@ AMQP_CONSUMER_ROUTING_KEY = getattr(settings,
 
 
 """
 """
 .. data:: AMQP_CONSUMER_QUEUE
 .. data:: AMQP_CONSUMER_QUEUE
-   
+
     The name of the AMQP queue.
     The name of the AMQP queue.
 
 
 """
 """

+ 2 - 2
celery/datastructures.py

@@ -120,7 +120,7 @@ class TaskProcessQueue(object):
             self._start()
             self._start()
 
 
         self._processed_total = self._process_counter.next()
         self._processed_total = self._process_counter.next()
-        
+
         on_return = lambda r: self.on_return(r, task_name, task_id)
         on_return = lambda r: self.on_return(r, task_name, task_id)
 
 
         result = self._pool.apply_async(target, args, kwargs,
         result = self._pool.apply_async(target, args, kwargs,
@@ -152,7 +152,7 @@ class TaskProcessQueue(object):
         :param task_id: Id of the task executed.
         :param task_id: Id of the task executed.
 
 
         """
         """
-      
+
         self._processes[task_id] = [result, task_name]
         self._processes[task_id] = [result, task_name]
 
 
         if self.full():
         if self.full():

+ 1 - 1
celery/result.py

@@ -123,7 +123,7 @@ class AsyncResult(BaseAsyncResult):
 
 
     :param task_id: see :attr:`task_id`.
     :param task_id: see :attr:`task_id`.
 
 
-    
+
     .. attribute:: task_id
     .. attribute:: task_id
 
 
         The unique identifier for this task.
         The unique identifier for this task.

+ 1 - 1
celery/task.py

@@ -276,7 +276,7 @@ class Task(object):
         :rtype: :class:`celery.result.AsyncResult`
         :rtype: :class:`celery.result.AsyncResult`
 
 
         See :func:`apply_async`.
         See :func:`apply_async`.
-        
+
         """
         """
         return apply_async(cls, args, kwargs, **options)
         return apply_async(cls, args, kwargs, **options)
 
 

+ 9 - 9
celery/worker.py

@@ -26,7 +26,7 @@ class UnknownTask(Exception):
 
 
 
 
 def jail(task_id, func, args, kwargs):
 def jail(task_id, func, args, kwargs):
-    """Wraps the task in a jail, which catches all exceptions, and 
+    """Wraps the task in a jail, which catches all exceptions, and
     saves the status and result of the task execution to the task
     saves the status and result of the task execution to the task
     meta backend.
     meta backend.
 
 
@@ -57,7 +57,7 @@ def jail(task_id, func, args, kwargs):
 
 
 class TaskWrapper(object):
 class TaskWrapper(object):
     """Class wrapping a task to be run.
     """Class wrapping a task to be run.
-    
+
     :param task_name: see :attr:`task_name`.
     :param task_name: see :attr:`task_name`.
 
 
     :param task_id: see :attr:`task_id`.
     :param task_id: see :attr:`task_id`.
@@ -71,7 +71,7 @@ class TaskWrapper(object):
     .. attribute:: task_name
     .. attribute:: task_name
 
 
         Kind of task. Must be a name registered in the task registry.
         Kind of task. Must be a name registered in the task registry.
-    
+
     .. attribute:: task_id
     .. attribute:: task_id
 
 
         UUID of the task.
         UUID of the task.
@@ -87,7 +87,7 @@ class TaskWrapper(object):
     .. attribute:: kwargs
     .. attribute:: kwargs
 
 
         Mapping of keyword arguments to apply to the task.
         Mapping of keyword arguments to apply to the task.
-    
+
     """
     """
 
 
     def __init__(self, task_name, task_id, task_func, args, kwargs):
     def __init__(self, task_name, task_id, task_func, args, kwargs):
@@ -141,7 +141,7 @@ class TaskWrapper(object):
     def execute(self, loglevel=None, logfile=None):
     def execute(self, loglevel=None, logfile=None):
         """Execute the task in a :func:`jail` and store return value
         """Execute the task in a :func:`jail` and store return value
         and status in the task meta backend.
         and status in the task meta backend.
-       
+
         :keyword loglevel: The loglevel used by the task.
         :keyword loglevel: The loglevel used by the task.
 
 
         :keyword logfile: The logfile used by the task.
         :keyword logfile: The logfile used by the task.
@@ -172,9 +172,9 @@ class TaskWrapper(object):
 
 
 class WorkController(object):
 class WorkController(object):
     """Executes tasks waiting in the task queue.
     """Executes tasks waiting in the task queue.
-    
+
     :param concurrency: see :attr:`concurrency`.
     :param concurrency: see :attr:`concurrency`.
-    
+
     :param logfile: see :attr:`logfile`.
     :param logfile: see :attr:`logfile`.
 
 
     :param loglevel: see :attr:`loglevel`.
     :param loglevel: see :attr:`loglevel`.
@@ -244,7 +244,7 @@ class WorkController(object):
     def reset_connection(self):
     def reset_connection(self):
         """Reset the AMQP connection, and reinitialize the
         """Reset the AMQP connection, and reinitialize the
         :class:`celery.messaging.TaskConsumer` instance.
         :class:`celery.messaging.TaskConsumer` instance.
-       
+
         Resets the task consumer in :attr:`task_consumer`.
         Resets the task consumer in :attr:`task_consumer`.
 
 
         """
         """
@@ -313,7 +313,7 @@ class WorkController(object):
         self.logger.debug("Trying to fetch a task.")
         self.logger.debug("Trying to fetch a task.")
         task, message = self.fetch_next_task()
         task, message = self.fetch_next_task()
         self.logger.debug("Got a task: %s. Trying to execute it..." % task)
         self.logger.debug("Got a task: %s. Trying to execute it..." % task)
-        
+
         result = task.execute_using_pool(self.pool, self.loglevel,
         result = task.execute_using_pool(self.pool, self.loglevel,
                                          self.logfile)
                                          self.logfile)