diff options
author | Armin Ronacher <armin.ronacher@active-4.com> | 2008-05-12 09:00:03 +0200 |
---|---|---|
committer | Armin Ronacher <armin.ronacher@active-4.com> | 2008-05-12 09:00:03 +0200 |
commit | 69e12dbb951fad8bfb7e92b8b3060aff288b5b98 (patch) | |
tree | 916d709a7ee62d4cb665ba0e8f823279dec03857 /jinja2/ext.py | |
parent | 1de4c644c91e94b97e2a95e318a005dc617ccebf (diff) | |
download | jinja2-69e12dbb951fad8bfb7e92b8b3060aff288b5b98.tar.gz |
improved variable exporting, added TODO file
--HG--
branch : trunk
Diffstat (limited to 'jinja2/ext.py')
-rw-r--r-- | jinja2/ext.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/jinja2/ext.py b/jinja2/ext.py index aac7528..117c2f3 100644 --- a/jinja2/ext.py +++ b/jinja2/ext.py @@ -77,17 +77,17 @@ class Extension(object): def attr(self, name, lineno=None): """Return an attribute node for the current extension. This is useful - to pass callbacks to template code:: + to pass constants on extensions to generated template code:: - nodes.Call(self.attr('_my_callback'), args, kwargs, None, None) - - That would call `self._my_callback` when the template is evaluated. + self.attr('_my_attribute', lineno=lineno) """ return nodes.ExtensionAttribute(self.identifier, name, lineno=lineno) def call_method(self, name, args=None, kwargs=None, dyn_args=None, dyn_kwargs=None, lineno=None): - """Call a method of the extension.""" + """Call a method of the extension. This is a shortcut for + :meth:`attr` + :class:`jinja2.nodes.Call`. + """ if args is None: args = [] if kwargs is None: |