Browse Source

Even more documentation, and fixes rst syntax errors.

Ask Solem 16 years ago
parent
commit
031a7b1c02

+ 34 - 3
celery/bin/celeryd

@@ -1,5 +1,36 @@
 #!/usr/bin/env python
-"""celeryd"""
+"""celeryd
+
+.. program:: celeryd
+
+.. cmdoption:: -c, --concurrency
+            
+    Number of child processes processing the queue.
+
+.. cmdoption:: -f, --logfile
+
+    Path to log file. If no logfile is specified, ``stderr`` is used.
+
+.. cmdoption:: -l, --loglevel
+
+    Logging level, choose between ``DEBUG``, ``INFO``, ``WARNING``,
+    ``ERROR``, ``CRITICAL``, or ``FATAL``.
+
+.. cmdoption:: -p, --pidfile
+
+    Path to pidfile.
+
+.. cmdoption:: -w, --wakeup-after
+
+    If the queue is empty, this is the time *in seconds* the
+    daemon sleeps until it wakes up to check if there's any
+    new messages on the queue.
+
+.. cmdoption:: -d, --daemon
+
+    Run in the background as a daemon.
+
+"""
 import os
 import sys
 sys.path.append(os.getcwd())
@@ -63,7 +94,7 @@ def parse_options(arguments):
             help="Choose between DEBUG/INFO/WARNING/ERROR/CRITICAL/FATAL.")
     parser.add_option('-p', '--pidfile', default=DAEMON_PID_FILE,
             action="store", dest="pidfile",
-            help="Path to PID file.")
+            help="Path to pidfile.")
     parser.add_option('-w', '--wakeup-after', default=QUEUE_WAKEUP_AFTER,
             action="store", dest="queue_wakeup_after",
             help="If the queue is empty, this is the time *in seconds* the "
@@ -71,7 +102,7 @@ def parse_options(arguments):
                  "new messages on the queue.")
     parser.add_option('-d', '--daemon', default=False,
             action="store_true", dest="daemon",
-            help="Run in background as a daemon.")
+            help="Run in the background as a daemon.")
     options, values = parser.parse_args(arguments)
     if not isinstance(options.loglevel, int):
         options.loglevel = LOG_LEVELS[options.loglevel.upper()]

+ 1 - 0
celery/worker.py

@@ -141,6 +141,7 @@ class TaskDaemon(object):
         The :class:`logging.Logger` instance used for logging.
 
     .. attribute:: pool
+        
         The :class:`multiprocessing.Pool` instance used.
 
     .. attribute:: task_consumer

+ 0 - 5
docs/reference/celery.conf.py

@@ -1,5 +0,0 @@
-===============================
-Configuration
-===============================
-
-

+ 11 - 0
docs/reference/celery.conf.rst

@@ -8,40 +8,51 @@ Configuration - celery.conf
     :members:
 
 .. data:: AMQP_EXCHANGE
+
     The AMQP exchange.
 
 .. data:: AMQP_ROUTING_KEY
+   
     The AMQP routing key.
 
 .. data:: AMQP_CONSUMER_QUEUE
+   
     The name of the AMQP queue.
 
 .. data:: DAEMON_CONCURRENCY
+   
     The number of worker processes, that should work simultaenously.
 
 .. data:: DAEMON_PID_FILE
+   
     Full path to the daemon pid file.
 
 .. data:: EMPTY_MSG_EMIT_EVERY
+   
     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
     this message.
 
 .. data:: QUEUE_WAKEUP_AFTER
+   
     The time (in seconds) the celery daemon should sleep when there are no messages
     left on the queue. After the time is slept, the worker wakes up and
     checks the queue again.
 
 .. data:: DAEMON_LOG_LEVEL
+   
     Celery daemon log level, could be any of ``DEBUG``, ``INFO``, ``WARNING``,
     ``ERROR``, ``CRITICAL``, or ``FATAL``.
 
 .. data:: DAEMON_LOG_FILE
+   
     The path to the deamon log file (if not set, ``stderr`` is used).
 
 .. data:: LOG_FORMAT
+   
     The format to use for log messages.
     Default is ``[%(asctime)s: %(levelname)s/%(processName)s] %(message)s``
 
 .. data:: LOG_LEVELS
+   
     Mapping of log level names to ``logging`` module constants.

+ 1 - 1
docs/reference/celery.datastructures.rst

@@ -5,4 +5,4 @@ Datastructures - celery.datastructures
 .. currentmodule:: celery.datastructures
 
 .. automodule:: celery.datastructures
-    ::members::
+    :members:

+ 17 - 0
docs/reference/celery.models.rst

@@ -3,58 +3,75 @@ Django Models - celery.models
 ===============================
 
 .. data:: TASK_STATUS_PENDING
+
     The string status of a pending task.
 
 .. data:: TASK_STATUS_RETRY
+   
     The string status of a task which is to be retried.
 
 .. data:: TASK_STATUS_FAILURE
+   
     The string status of a failed task.
 
 .. data:: TASK_STATUS_DONE
+   
     The string status of a task that was successfully executed.
 
 .. data:: TASK_STATUSES
+   
     List of possible task statuses.
 
 .. data:: TASK_STATUSES_CHOICES
+   
     Django choice tuple of possible task statuses, for usage in model/form
     fields ``choices`` argument.
 
 .. class:: TaskMeta
+   
     Model for storing the result and status of a task.
     
     *Note* Only used if you're running the ``database`` backend.
 
     .. attribute:: task_id
+
         The unique task id.
 
     .. attribute:: status
+
         The current status for this task.
 
     .. attribute:: result
+        
         The result after successful/failed execution. If the task failed,
         this contains the execption it raised.
 
     .. attribute:: date_done
+
         The date this task changed status.
 
 .. class:: PeriodicTaskMeta
+   
     Metadata model for periodic tasks.
 
     .. attribute:: name
+       
         The name of this task, as registered in the task registry.
 
     .. attribute:: last_run_at
+
         The date this periodic task was last run. Used to find out
         when it should be run next.
 
     .. attribute:: total_run_count
+       
         The number of times this periodic task has been run.
 
     .. attribute:: task
+       
         The class/function for this task.
 
     .. method:: delay()
+        
         Delay the execution of a periodic task, and increment its total
         run count.