Explorar el Código

schedules: documents nowfun. Closes #1577

Ask Solem hace 11 años
padre
commit
f128b2cee6
Se han modificado 1 ficheros con 19 adiciones y 0 borrados
  1. 19 0
      celery/schedules.py

+ 19 - 0
celery/schedules.py

@@ -56,6 +56,16 @@ class ParseException(Exception):
 
 
 
 
 class schedule(object):
 class schedule(object):
+    """Schedule for periodic task.
+
+    :param run_every: Interval in seconds (or a :class:`~datetime.timedelta`).
+    :param relative:  If set to True the run time will be rounded to the
+        resolution of the interval.
+    :param nowfun: Function returning the current date and time
+        (class:`~datetime.datetime`).
+    :param app: Celery app instance.
+
+    """
     relative = False
     relative = False
 
 
     def __init__(self, run_every=None, relative=False, nowfun=None, app=None):
     def __init__(self, run_every=None, relative=False, nowfun=None, app=None):
@@ -327,6 +337,15 @@ class crontab(schedule):
           of every quarter) or `month_of_year='2-12/2'` (for every even
           of every quarter) or `month_of_year='2-12/2'` (for every even
           numbered month).
           numbered month).
 
 
+    .. attribute:: nowfun
+
+        Function returning the current date and time
+        (:class:`~datetime.datetime`).
+
+    .. attribute:: app
+
+        The Celery app instance.
+
     It is important to realize that any day on which execution should
     It is important to realize that any day on which execution should
     occur must be represented by entries in all three of the day and
     occur must be represented by entries in all three of the day and
     month attributes.  For example, if `day_of_week` is 0 and `day_of_month`
     month attributes.  For example, if `day_of_week` is 0 and `day_of_month`