# HG changeset patch # User Thierry Florac # Date 1497880498 -7200 # Node ID bf448402f41d39ab619b5d1a809c8daa3c01216f # Parent 483b701c99db5c3ce92cadbac4dfc95147d64982 Updated docstrings diff -r 483b701c99db -r bf448402f41d src/pyams_utils/fanstatic.py --- a/src/pyams_utils/fanstatic.py Mon Jun 19 15:45:39 2017 +0200 +++ b/src/pyams_utils/fanstatic.py Mon Jun 19 15:54:58 2017 +0200 @@ -9,7 +9,6 @@ # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # -from pyramid.path import DottedNameResolver __docformat__ = 'restructuredtext' @@ -23,6 +22,7 @@ from fanstatic import Resource from fanstatic.core import set_resource_file_existence_checking, render_css, NeededResources from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter +from pyramid.path import DottedNameResolver from zope.interface import Interface @@ -62,7 +62,17 @@ @adapter_config(name='resource_path', context=(Interface, Interface, Interface), provides=ITALESExtension) class FanstaticTalesExtension(ContextRequestViewAdapter): - """extension:fanstatic() TALES extension""" + """extension:resource_path() TALES extension + + This TALES extension generates an URL matching a given Fanstatic resource. + Resource is given as a string made of package name (in dotted form) followed by a colon and by the resource name. + + For example:: + + .. code-block:: html + +
+ """ def render(self, resource): library, resource_name = resource.split(':')