Browse Source

Document attributes in result classes.

Ask Solem 16 years ago
parent
commit
6ad71a5e82
2 changed files with 34 additions and 2 deletions
  1. 21 2
      celery/result.py
  2. 13 0
      contrib/doc2ghpages

+ 21 - 2
celery/result.py

@@ -3,7 +3,17 @@ from celery.backends import default_backend
 
 
 class BaseAsyncResult(object):
-    """Base class for pending result, takes ``backend`` argument."""
+    """Base class for pending result, takes ``backend`` argument.
+    
+    .. attribute:: task_id
+
+        The unique identifier for this task.
+
+    .. attribute:: backend
+       
+        The task result backend used.
+    
+    """
 
     def __init__(self, task_id, backend):
         self.task_id = task_id
@@ -58,7 +68,16 @@ class BaseAsyncResult(object):
 
 
 class AsyncResult(BaseAsyncResult):
-    """Pending task result using the default backend.""" 
+    """Pending task result using the default backend.
+
+    .. attribute:: task_id
+    
+        The unique identifier for this task.
+
+    .. attribute:: backend
+    
+        Instance of ``celery.backends.DefaultBackend``.
 
+    """
     def __init__(self, task_id):
         super(AsyncResult, self).__init__(task_id, backend=default_backend)

+ 13 - 0
contrib/doc2ghpages

@@ -0,0 +1,13 @@
+#!/bin/bash
+
+git checkout master
+(cd docs;
+    rm -rf .build;
+    make html;
+    (cd .build/html;
+        sphinx-to-github;))
+git checkout gh-pages
+cp -r docs/.build/html/* .
+git commit . -m "Autogenerated documentation for github."
+git push --all
+git checkout master