fixed a bug in extension handling
--HG--
branch : trunk
diff --git a/jinja2/ext.py b/jinja2/ext.py
index f60b85a..53b4041 100644
--- a/jinja2/ext.py
+++ b/jinja2/ext.py
@@ -73,6 +73,7 @@
is the name token that matched. This method has to return one or a
list of multiple nodes.
"""
+ raise NotImplementedError()
def attr(self, name, lineno=None):
"""Return an attribute node for the current extension. This is useful
@@ -84,6 +85,16 @@
"""
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."""
+ if args is None:
+ args = []
+ if kwargs is None:
+ kwargs = []
+ return nodes.Call(self.attr(name, lineno=lineno), args, kwargs,
+ dyn_args, dyn_kwargs, lineno=lineno)
+
class InternationalizationExtension(Extension):
"""This extension adds gettext support to Jinja2."""