From 4266fdc396908a27b7b38433e684615c8bbc9cb1 Mon Sep 17 00:00:00 2001 From: Sean Hammond Date: Thu, 21 Nov 2013 13:14:22 +0100 Subject: [PATCH] [#847] Fix Sphinx errors in helpers.py --- ckan/lib/helpers.py | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/ckan/lib/helpers.py b/ckan/lib/helpers.py index 94e30bc8fc2..069d3727bce 100644 --- a/ckan/lib/helpers.py +++ b/ckan/lib/helpers.py @@ -392,10 +392,10 @@ def _create_link_text(text, **kwargs): def nav_link(text, *args, **kwargs): ''' - params - class_: pass extra class(s) to add to the tag - icon: name of ckan icon to use within the link - condition: if False then no link is returned + :param class_: pass extra class(es) to add to the ```` tag + :param icon: name of ckan icon to use within the link + :param condition: if ``False`` then no link is returned + ''' if len(args) > 1: raise Exception('Too many unnamed parameters supplied') @@ -459,35 +459,37 @@ def build_nav_main(*args): def build_nav_icon(menu_item, title, **kw): - ''' build a navigation item used for example in user/read_base.html + '''Build a navigation item used for example in ``user/read_base.html``. - outputs
  • title
  • + Outputs ``
  • title
  • ``. :param menu_item: the name of the defined menu item defined in - config/routing as the named route of the same name + config/routing as the named route of the same name :type menu_item: string :param title: text used for the link :type title: string - :param **kw: additional keywords needed for creating url eg id=... + :param kw: additional keywords needed for creating url eg ``id=...`` :rtype: HTML literal + ''' return _make_menu_item(menu_item, title, **kw) def build_nav(menu_item, title, **kw): - ''' build a navigation item used for example breadcrumbs + '''Build a navigation item used for example breadcrumbs. - outputs
  • title
  • + Outputs ``
  • title
  • ``. :param menu_item: the name of the defined menu item defined in - config/routing as the named route of the same name + config/routing as the named route of the same name :type menu_item: string :param title: text used for the link :type title: string - :param **kw: additional keywords needed for creating url eg id=... + :param kw: additional keywords needed for creating url eg ``id=...`` :rtype: HTML literal + ''' return _make_menu_item(menu_item, title, icon=None, **kw) @@ -1208,9 +1210,9 @@ def add_url_param(alternative_url=None, controller=None, action=None, ''' Adds extra parameters to existing ones - controller action & extras (dict) are used to create the base url - via url_for(controller=controller, action=action, **extras) - controller & action default to the current ones + controller action & extras (dict) are used to create the base url via + :py:func:`~ckan.lib.helpers.url_for` controller & action default to the + current ones This can be overriden providing an alternative_url, which will be used instead. @@ -1238,11 +1240,12 @@ def remove_url_param(key, value=None, replace=None, controller=None, provided (or the only one provided if key is a string). controller action & extras (dict) are used to create the base url - via url_for(controller=controller, action=action, **extras) + via :py:func:`~ckan.lib.helpers.url_for` controller & action default to the current ones This can be overriden providing an alternative_url, which will be used instead. + ''' if isinstance(key, basestring): keys = [key]