Browse Source

Fixes documentation build

Ask Solem 10 years ago
parent
commit
6df0f36f5b
3 changed files with 8 additions and 5 deletions
  1. 1 1
      celery/app/task.py
  2. 1 1
      celery/task/base.py
  3. 6 3
      docs/_ext/celerydocs.py

+ 1 - 1
celery/app/task.py

@@ -432,7 +432,7 @@ class Task(object):
         :keyword link_error: A single, or a list of tasks to apply
                       if an error occurs while executing the task.
 
-        :keyword producer: :class:`~@kombu.Producer` instance to use.
+        :keyword producer: :class:`kombu.Producer` instance to use.
         :keyword add_to_parent: If set to True (default) and the task
             is applied while executing another task, then the result
             will be appended to the parent tasks ``request.children``

+ 1 - 1
celery/task/base.py

@@ -201,7 +201,7 @@ class Task(BaseTask):
                       exchange_type=None, **options):
         """Deprecated method to get the task publisher (now called producer).
 
-        Should be replaced with :class:`@kombu.Producer`:
+        Should be replaced with :class:`kombu.Producer`:
 
         .. code-block:: python
 

+ 6 - 3
docs/_ext/celerydocs.py

@@ -65,14 +65,16 @@ def shorten(S, newtarget, src_dict):
     return S
 
 
-def get_abbr(pre, rest, type):
+def get_abbr(pre, rest, type, orig=None):
     if pre:
         for d in APPATTRS, ABBRS:
             try:
                 return d[pre], rest, d
             except KeyError:
                 pass
-        raise KeyError(pre)
+        raise KeyError('Unknown abbreviation: {0} ({1})'.format(
+            '.'.join([pre, rest]) if orig is None else orig, type,
+        ))
     else:
         for d in APPATTRS, ABBRS:
             try:
@@ -83,6 +85,7 @@ def get_abbr(pre, rest, type):
 
 
 def resolve(S, type):
+    orig = S
     if S.startswith('@'):
         S = S.lstrip('@-')
         try:
@@ -90,7 +93,7 @@ def resolve(S, type):
         except ValueError:
             pre, rest = '', S
 
-        target, rest, src = get_abbr(pre, rest, type)
+        target, rest, src = get_abbr(pre, rest, type, orig)
         return '.'.join([target, rest]) if rest else target, src
     return S, None