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
         :keyword link_error: A single, or a list of tasks to apply
                       if an error occurs while executing the task.
                       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
         :keyword add_to_parent: If set to True (default) and the task
             is applied while executing another task, then the result
             is applied while executing another task, then the result
             will be appended to the parent tasks ``request.children``
             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):
                       exchange_type=None, **options):
         """Deprecated method to get the task publisher (now called producer).
         """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
         .. code-block:: python
 
 

+ 6 - 3
docs/_ext/celerydocs.py

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