Browse Source

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

Ask Solem 15 years ago
parent
commit
acfb51c045
4 changed files with 9 additions and 11 deletions
  1. 1 1
      celery/serialization.py
  2. 2 2
      celery/task/__init__.py
  3. 4 4
      celery/task/base.py
  4. 2 4
      celery/worker/job.py

+ 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,
         if it is it returns ``None``.
 
-    :rtype: :exc:`Exception`
+    :rtype :exc:`Exception`:
 
     """
     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
     asynchronously.
 
-    :returns: :class:`celery.result.AsyncResult` object.
+    :returns :class:`celery.result.AsyncResult`:
 
     Example
 
@@ -64,7 +64,7 @@ def execute_remote(fun, *args, **kwargs):
     The object must be picklable, so you can't use lambdas or functions
     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)

+ 4 - 4
celery/task/base.py

@@ -268,7 +268,7 @@ class Task(object):
             exchange_type=None):
         """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
         with this object, i.e.:
@@ -293,7 +293,7 @@ class Task(object):
             connect_timeout=conf.BROKER_CONNECTION_TIMEOUT):
         """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
         with this object. i.e.:
@@ -331,7 +331,7 @@ class Task(object):
 
         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 kwargs: keyword arguments passed on to the task.
-        :rtype: :class:`celery.result.EagerResult`
+        :rtype :class:`celery.result.EagerResult`:
 
         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 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.
 
     """
@@ -244,7 +244,7 @@ class TaskRequest(object):
         :raises UnknownTaskError: if the message does not describe a task,
             the message is also rejected.
 
-        :returns: :class:`TaskRequest` instance.
+        :returns :class:`TaskRequest`:
 
         """
         task_name = message_data["task"]
@@ -338,8 +338,6 @@ class TaskRequest(object):
 
         :keyword logfile: The logfile used by the task.
 
-        :returns :class:`multiprocessing.AsyncResult` instance.
-
         """
         if self.revoked():
             return