Explorar o código

Add some missing docstrings for celery.task.base

Ask Solem %!s(int64=15) %!d(string=hai) anos
pai
achega
c6a4a209e5
Modificáronse 1 ficheiros con 13 adicións e 4 borrados
  1. 13 4
      celery/task/base.py

+ 13 - 4
celery/task/base.py

@@ -112,6 +112,12 @@ class Task(object):
         limit), ``"100/s"`` (hundred tasks a second), ``"100/m"`` (hundred
         tasks a minute), ``"100/h"`` (hundred tasks an hour)
 
+    .. attribute:: rate_limit_queue_type
+
+        Type of queue used by the rate limiter for this kind of tasks.
+        Default is a :class:`Queue.Queue`, but you can change this to
+        a :class:`Queue.LifoQueue` or an invention of your own.
+
     .. attribute:: ignore_result
 
         Don't store the return value of this task.
@@ -130,6 +136,11 @@ class Task(object):
 
         The result store backend used for this task.
 
+    .. attribute:: autoregister
+        If ``True`` the task is automatically registered in the task
+        registry, which is the default behaviour.
+
+
     The resulting class is callable, which if called will apply the
     :meth:`run` method.
 
@@ -181,16 +192,14 @@ class Task(object):
         arguments (\*\*kwargs).
 
         """
-        raise NotImplementedError("Tasks must define a run method.")
+        raise NotImplementedError("Tasks must define the run method.")
 
-    def get_logger(self, **kwargs):
+    def get_logger(self, loglevel=None, logfile=None, **kwargs):
         """Get process-aware logger object.
 
         See :func:`celery.log.setup_logger`.
 
         """
-        logfile = kwargs.get("logfile")
-        loglevel = kwargs.get("loglevel")
         return setup_logger(loglevel=loglevel, logfile=logfile)
 
     def establish_connection(self,