Przeglądaj źródła

API reference: Fix :returns: / :rtype: so they work with Sphinx 1.0b2

Ask Solem 15 lat temu
rodzic
commit
acfb51c045

+ 1 - 1
celery/serialization.py

@@ -57,7 +57,7 @@ def find_nearest_pickleable_exception(exc):
     :returns: the nearest exception if it's not :exc:`Exception` or below,
     :returns: the nearest exception if it's not :exc:`Exception` or below,
         if it is it returns ``None``.
         if it is it returns ``None``.
 
 
-    :rtype: :exc:`Exception`
+    :rtype :exc:`Exception`:
 
 
     """
     """
     cls = exc.__class__
     cls = exc.__class__

+ 2 - 2
celery/task/__init__.py

@@ -36,7 +36,7 @@ def dmap_async(fun, args, timeout=None):
     """Distribute processing of the arguments and collect the results
     """Distribute processing of the arguments and collect the results
     asynchronously.
     asynchronously.
 
 
-    :returns: :class:`celery.result.AsyncResult` object.
+    :returns :class:`celery.result.AsyncResult`:
 
 
     Example
     Example
 
 
@@ -64,7 +64,7 @@ def execute_remote(fun, *args, **kwargs):
     The object must be picklable, so you can't use lambdas or functions
     The object must be picklable, so you can't use lambdas or functions
     defined in the REPL (the objects must have an associated module).
     defined in the REPL (the objects must have an associated module).
 
 
-    :returns: class:`celery.result.AsyncResult`.
+    :returns class:`celery.result.AsyncResult`:
 
 
     """
     """
     return ExecuteRemoteTask.delay(pickle.dumps(fun), args, kwargs)
     return ExecuteRemoteTask.delay(pickle.dumps(fun), args, kwargs)

+ 4 - 4
celery/task/base.py

@@ -268,7 +268,7 @@ class Task(object):
             exchange_type=None):
             exchange_type=None):
         """Get a celery task message publisher.
         """Get a celery task message publisher.
 
 
-        :rtype: :class:`celery.messaging.TaskPublisher`.
+        :rtype :class:`celery.messaging.TaskPublisher`:
 
 
         Please be sure to close the AMQP connection when you're done
         Please be sure to close the AMQP connection when you're done
         with this object, i.e.:
         with this object, i.e.:
@@ -293,7 +293,7 @@ class Task(object):
             connect_timeout=conf.BROKER_CONNECTION_TIMEOUT):
             connect_timeout=conf.BROKER_CONNECTION_TIMEOUT):
         """Get a celery task message consumer.
         """Get a celery task message consumer.
 
 
-        :rtype: :class:`celery.messaging.TaskConsumer`.
+        :rtype :class:`celery.messaging.TaskConsumer`:
 
 
         Please be sure to close the AMQP connection when you're done
         Please be sure to close the AMQP connection when you're done
         with this object. i.e.:
         with this object. i.e.:
@@ -331,7 +331,7 @@ class Task(object):
 
 
         See :func:`celery.execute.apply_async` for more information.
         See :func:`celery.execute.apply_async` for more information.
 
 
-        :rtype: :class:`celery.result.AsyncResult`
+        :returns: :class:`celery.result.AsyncResult`
 
 
 
 
         """
         """
@@ -413,7 +413,7 @@ class Task(object):
 
 
         :param args: positional arguments passed on to the task.
         :param args: positional arguments passed on to the task.
         :param kwargs: keyword arguments passed on to the task.
         :param kwargs: keyword arguments passed on to the task.
-        :rtype: :class:`celery.result.EagerResult`
+        :rtype :class:`celery.result.EagerResult`:
 
 
         See :func:`celery.execute.apply`.
         See :func:`celery.execute.apply`.
 
 

+ 2 - 4
celery/worker/job.py

@@ -65,7 +65,7 @@ class WorkerTaskTrace(TaskTrace):
     :param args: List of positional args to pass on to the function.
     :param args: List of positional args to pass on to the function.
     :param kwargs: Keyword arguments mapping to pass on to the function.
     :param kwargs: Keyword arguments mapping to pass on to the function.
 
 
-    :returns: the function return value on success, or
+    :returns: the evaluated functions return value on success, or
         the exception instance on failure.
         the exception instance on failure.
 
 
     """
     """
@@ -244,7 +244,7 @@ class TaskRequest(object):
         :raises UnknownTaskError: if the message does not describe a task,
         :raises UnknownTaskError: if the message does not describe a task,
             the message is also rejected.
             the message is also rejected.
 
 
-        :returns: :class:`TaskRequest` instance.
+        :returns :class:`TaskRequest`:
 
 
         """
         """
         task_name = message_data["task"]
         task_name = message_data["task"]
@@ -338,8 +338,6 @@ class TaskRequest(object):
 
 
         :keyword logfile: The logfile used by the task.
         :keyword logfile: The logfile used by the task.
 
 
-        :returns :class:`multiprocessing.AsyncResult` instance.
-
         """
         """
         if self.revoked():
         if self.revoked():
             return
             return