Browse Source

Doc fixes

Ask Solem 11 years ago
parent
commit
b80a8e35fa

+ 3 - 3
celery/datastructures.py

@@ -324,9 +324,9 @@ class DependencyGraph(object):
 
 
 class AttributeDictMixin(object):
-    """Adds attribute access to mappings.
+    """Augment classes with a Mapping interface by adding attribute access.
 
-    `d.key -> d[key]`
+    I.e. `d.key -> d[key]`.
 
     """
 
@@ -473,7 +473,7 @@ class ConfigurationView(AttributeDictMixin):
             return default
 
     def clear(self):
-        """Removes all changes, but keeps defaults."""
+        """Remove all changes, but keep defaults."""
         self.changes.clear()
 
     def setdefault(self, key, default):

+ 2 - 2
celery/platforms.py

@@ -144,12 +144,12 @@ class Pidfile(object):
                         'pidfile {0.path} contents invalid.'.format(self))
 
     def remove(self):
-        """Removes the lock."""
+        """Remove the lock."""
         with ignore_errno(errno.ENOENT, errno.EACCES):
             os.unlink(self.path)
 
     def remove_if_stale(self):
-        """Removes the lock if the process is not running.
+        """Remove the lock if the process is not running.
         (does not respond to signals)."""
         try:
             pid = self.read_pid()

+ 1 - 1
celery/result.py

@@ -327,7 +327,7 @@ class ResultSet(ResultBase):
             self.results.append(result)
 
     def remove(self, result):
-        """Removes result from the set; it must be a member.
+        """Remove result from the set; it must be a member.
 
         :raises KeyError: if the result is not a member.
 

+ 1 - 1
celery/utils/functional.py

@@ -294,6 +294,6 @@ class _regen(UserList, list):
 
 
 def dictfilter(d=None, **kw):
-    """Removes keys from dict ``d`` where value is :const:`None`"""
+    """Remove all keys from dict ``d`` whose value is :const:`None`"""
     d = kw if d is None else (dict(d, **kw) if kw else d)
     return dict((k, v) for k, v in items(d) if v is not None)

+ 1 - 1
celery/utils/threads.py

@@ -219,7 +219,7 @@ class _LocalStack(object):
         return rv
 
     def pop(self):
-        """Removes the topmost item from the stack, will return the
+        """Remove the topmost item from the stack, will return the
         old value or `None` if the stack was already empty.
         """
         stack = getattr(self._local, 'stack', None)

+ 1 - 1
celery/worker/state.py

@@ -54,7 +54,7 @@ total_count = Counter()
 #: the list of currently revoked tasks.  Persistent if statedb set.
 revoked = LimitedSet(maxlen=REVOKES_MAX, expires=REVOKE_EXPIRES)
 
-#: Updates global state when a task has been reserved.
+#: Update global state when a task has been reserved.
 task_reserved = reserved_requests.add
 
 should_stop = False

+ 8 - 2
docs/reference/celery.rst

@@ -32,6 +32,7 @@ and creating Celery applications.
 .. class:: Celery(main='__main__', broker='amqp://localhost//', ...)
 
     :param main: Name of the main module if running as `__main__`.
+        This is used as a prefix for task names.
     :keyword broker: URL of the default broker used.
     :keyword loader: The loader class, or the name of the loader class to use.
                      Default is :class:`celery.loaders.app.AppLoader`.
@@ -44,6 +45,9 @@ and creating Celery applications.
     :keyword control: Control object or class name.
     :keyword set_as_current:  Make this the global current app.
     :keyword tasks: A task registry or the name of a registry class.
+    :keyword include: List of modules every worker should import.
+    :keyword fixups: List of fixup plug-ins (see e.g.
+    :mod:`celery.fixups.django`).
 
     .. attribute:: Celery.main
 
@@ -111,9 +115,11 @@ and creating Celery applications.
 
     .. method:: Celery.close
 
-        Cleans-up after application, like closing any pool connections.
+        Close any open pool connections and do any other steps necessary
+        to clean up after the application.
+
         Only necessary for dynamically created apps for which you can
-        use the with statement::
+        use the with statement instead::
 
             with Celery(set_as_current=False) as app:
                 with app.connection() as conn: