Browse Source

Documentation fixes

Ask Solem 8 năm trước cách đây
mục cha
commit
cfa06aa519

+ 1 - 4
celery/utils/time.py

@@ -274,10 +274,7 @@ def maybe_iso8601(dt):
 
 
 def is_naive(dt):
-    """Return :const:`True` if :class:`~datetime.datetime` is naive*.
-
-    *does not have timezone information.
-    """
+    """Return :const:`True` if :class:`~datetime.datetime` is naive."""
     return dt.tzinfo is None or dt.tzinfo.utcoffset(dt) is None
 
 

+ 1 - 1
docs/contributing.rst

@@ -379,7 +379,7 @@ Tags
 ====
 
 - Tags are used exclusively for tagging releases. A release tag is
-named with the format ``vX.Y.Z`` -- for example ``v2.3.1``.
+  named with the format ``vX.Y.Z`` -- for example ``v2.3.1``.
 
 - Experimental releases contain an additional identifier ``vX.Y.Z-id`` --
   for example ``v3.0.0-rc1``.

+ 5 - 5
docs/django/first-steps-with-django.rst

@@ -123,7 +123,7 @@ its own request information. This is using the new ``bind=True`` task option
 introduced in Celery 3.1 to easily refer to the current task instance.
 
 Using the ``@shared_task`` decorator
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+------------------------------------
 
 The tasks you write will probably live in reusable apps, and reusable
 apps cannot depend on the project itself, so you also cannot import your app
@@ -154,8 +154,8 @@ concrete app instance:
 Extensions
 ==========
 
-``django-celery-results`` -- Using the Django ORM/Cache as a result backend
----------------------------------------------------------------------------
+``django-celery-results`` - Using the Django ORM/Cache as a result backend
+--------------------------------------------------------------------------
 
 The :pypi:`django-celery-results` extension provides result backends
 using either the Django ORM, or the Django Cache framework.
@@ -193,8 +193,8 @@ To use this with your project you need to follow these steps:
 
         CELERY_RESULT_BACKEND = 'django-cache'
 
-``django-celery-beat`` -- Database-backed Periodic Tasks with Admin interface.
-------------------------------------------------------------------------------
+``django-celery-beat`` - Database-backed Periodic Tasks with Admin interface.
+-----------------------------------------------------------------------------
 
 See :ref:`beat-custom-schedulers` for more information.
 

+ 18 - 6
docs/userguide/calling.rst

@@ -175,7 +175,7 @@ as a partial argument.
 .. _calling-on-message:
 
 On message
-============================
+==========
 
 Celery supports catching all states changes by setting on_message callback.
 
@@ -202,11 +202,23 @@ For example for long-running tasks to send task progress you can do something li
 
 Will generate output like this:
 
-.. code-block:: 
-
-    {'task_id': '5660d3a3-92b8-40df-8ccc-33a5d1d680d7', 'result': {'progress': 50}, 'children': [], 'status': 'PROGRESS', 'traceback': None}
-    {'task_id': '5660d3a3-92b8-40df-8ccc-33a5d1d680d7', 'result': {'progress': 90}, 'children': [], 'status': 'PROGRESS', 'traceback': None}
-    {'task_id': '5660d3a3-92b8-40df-8ccc-33a5d1d680d7', 'result': 'hello world: 10', 'children': [], 'status': 'SUCCESS', 'traceback': None}
+.. code-block:: text
+
+    {'task_id': '5660d3a3-92b8-40df-8ccc-33a5d1d680d7',
+     'result': {'progress': 50},
+     'children': [],
+     'status': 'PROGRESS',
+     'traceback': None}
+    {'task_id': '5660d3a3-92b8-40df-8ccc-33a5d1d680d7',
+     'result': {'progress': 90},
+     'children': [],
+     'status': 'PROGRESS',
+     'traceback': None}
+    {'task_id': '5660d3a3-92b8-40df-8ccc-33a5d1d680d7',
+     'result': 'hello world: 10',
+     'children': [],
+     'status': 'SUCCESS',
+     'traceback': None}
     hello world: 10
 
 

+ 1 - 1
docs/userguide/configuration.rst

@@ -1023,7 +1023,7 @@ AuthProvider class within ``cassandra.auth`` module to use. Values can be
 
 Default: ``{}`` (empty mapping).
 
-Named arguments to pass into the authentication provider. For example::
+Named arguments to pass into the authentication provider. For example:
 
 .. code-block:: python