Jelajahi Sumber

Even more documentation, and fixes rst syntax errors.

Ask Solem 16 tahun lalu
induk
melakukan
031a7b1c02

+ 34 - 3
celery/bin/celeryd

@@ -1,5 +1,36 @@
 #!/usr/bin/env python
 #!/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 os
 import sys
 import sys
 sys.path.append(os.getcwd())
 sys.path.append(os.getcwd())
@@ -63,7 +94,7 @@ def parse_options(arguments):
             help="Choose between DEBUG/INFO/WARNING/ERROR/CRITICAL/FATAL.")
             help="Choose between DEBUG/INFO/WARNING/ERROR/CRITICAL/FATAL.")
     parser.add_option('-p', '--pidfile', default=DAEMON_PID_FILE,
     parser.add_option('-p', '--pidfile', default=DAEMON_PID_FILE,
             action="store", dest="pidfile",
             action="store", dest="pidfile",
-            help="Path to PID file.")
+            help="Path to pidfile.")
     parser.add_option('-w', '--wakeup-after', default=QUEUE_WAKEUP_AFTER,
     parser.add_option('-w', '--wakeup-after', default=QUEUE_WAKEUP_AFTER,
             action="store", dest="queue_wakeup_after",
             action="store", dest="queue_wakeup_after",
             help="If the queue is empty, this is the time *in seconds* the "
             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.")
                  "new messages on the queue.")
     parser.add_option('-d', '--daemon', default=False,
     parser.add_option('-d', '--daemon', default=False,
             action="store_true", dest="daemon",
             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)
     options, values = parser.parse_args(arguments)
     if not isinstance(options.loglevel, int):
     if not isinstance(options.loglevel, int):
         options.loglevel = LOG_LEVELS[options.loglevel.upper()]
         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.
         The :class:`logging.Logger` instance used for logging.
 
 
     .. attribute:: pool
     .. attribute:: pool
+        
         The :class:`multiprocessing.Pool` instance used.
         The :class:`multiprocessing.Pool` instance used.
 
 
     .. attribute:: task_consumer
     .. 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:
     :members:
 
 
 .. data:: AMQP_EXCHANGE
 .. data:: AMQP_EXCHANGE
+
     The AMQP exchange.
     The AMQP exchange.
 
 
 .. data:: AMQP_ROUTING_KEY
 .. data:: AMQP_ROUTING_KEY
+   
     The AMQP routing key.
     The AMQP routing key.
 
 
 .. data:: AMQP_CONSUMER_QUEUE
 .. data:: AMQP_CONSUMER_QUEUE
+   
     The name of the AMQP queue.
     The name of the AMQP queue.
 
 
 .. data:: DAEMON_CONCURRENCY
 .. data:: DAEMON_CONCURRENCY
+   
     The number of worker processes, that should work simultaenously.
     The number of worker processes, that should work simultaenously.
 
 
 .. data:: DAEMON_PID_FILE
 .. data:: DAEMON_PID_FILE
+   
     Full path to the daemon pid file.
     Full path to the daemon pid file.
 
 
 .. 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.
 
 
 .. data:: QUEUE_WAKEUP_AFTER
 .. data:: QUEUE_WAKEUP_AFTER
+   
     The time (in seconds) the celery daemon should sleep when there are no messages
     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
     left on the queue. After the time is slept, the worker wakes up and
     checks the queue again.
     checks the queue again.
 
 
 .. data:: DAEMON_LOG_LEVEL
 .. data:: DAEMON_LOG_LEVEL
+   
     Celery daemon log level, could be any of ``DEBUG``, ``INFO``, ``WARNING``,
     Celery daemon log level, could be any of ``DEBUG``, ``INFO``, ``WARNING``,
     ``ERROR``, ``CRITICAL``, or ``FATAL``.
     ``ERROR``, ``CRITICAL``, or ``FATAL``.
 
 
 .. 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).
 
 
 .. 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``
 
 
 .. data:: LOG_LEVELS
 .. data:: LOG_LEVELS
+   
     Mapping of log level names to ``logging`` module constants.
     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
 .. currentmodule:: celery.datastructures
 
 
 .. automodule:: 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
 .. data:: TASK_STATUS_PENDING
+
     The string status of a pending task.
     The string status of a pending task.
 
 
 .. data:: TASK_STATUS_RETRY
 .. data:: TASK_STATUS_RETRY
+   
     The string status of a task which is to be retried.
     The string status of a task which is to be retried.
 
 
 .. data:: TASK_STATUS_FAILURE
 .. data:: TASK_STATUS_FAILURE
+   
     The string status of a failed task.
     The string status of a failed task.
 
 
 .. data:: TASK_STATUS_DONE
 .. data:: TASK_STATUS_DONE
+   
     The string status of a task that was successfully executed.
     The string status of a task that was successfully executed.
 
 
 .. data:: TASK_STATUSES
 .. data:: TASK_STATUSES
+   
     List of possible task statuses.
     List of possible task statuses.
 
 
 .. data:: TASK_STATUSES_CHOICES
 .. data:: TASK_STATUSES_CHOICES
+   
     Django choice tuple of possible task statuses, for usage in model/form
     Django choice tuple of possible task statuses, for usage in model/form
     fields ``choices`` argument.
     fields ``choices`` argument.
 
 
 .. class:: TaskMeta
 .. class:: TaskMeta
+   
     Model for storing the result and status of a task.
     Model for storing the result and status of a task.
     
     
     *Note* Only used if you're running the ``database`` backend.
     *Note* Only used if you're running the ``database`` backend.
 
 
     .. attribute:: task_id
     .. attribute:: task_id
+
         The unique task id.
         The unique task id.
 
 
     .. attribute:: status
     .. attribute:: status
+
         The current status for this task.
         The current status for this task.
 
 
     .. attribute:: result
     .. attribute:: result
+        
         The result after successful/failed execution. If the task failed,
         The result after successful/failed execution. If the task failed,
         this contains the execption it raised.
         this contains the execption it raised.
 
 
     .. attribute:: date_done
     .. attribute:: date_done
+
         The date this task changed status.
         The date this task changed status.
 
 
 .. class:: PeriodicTaskMeta
 .. class:: PeriodicTaskMeta
+   
     Metadata model for periodic tasks.
     Metadata model for periodic tasks.
 
 
     .. attribute:: name
     .. attribute:: name
+       
         The name of this task, as registered in the task registry.
         The name of this task, as registered in the task registry.
 
 
     .. attribute:: last_run_at
     .. attribute:: last_run_at
+
         The date this periodic task was last run. Used to find out
         The date this periodic task was last run. Used to find out
         when it should be run next.
         when it should be run next.
 
 
     .. attribute:: total_run_count
     .. attribute:: total_run_count
+       
         The number of times this periodic task has been run.
         The number of times this periodic task has been run.
 
 
     .. attribute:: task
     .. attribute:: task
+       
         The class/function for this task.
         The class/function for this task.
 
 
     .. method:: delay()
     .. method:: delay()
+        
         Delay the execution of a periodic task, and increment its total
         Delay the execution of a periodic task, and increment its total
         run count.
         run count.