aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mako/codegen.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-03-08 01:27:21 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-03-08 01:27:21 +0000
commita7889d1be5516f1ef6b46cc0dc54b01f39f07a33 (patch)
tree1d894b78906a48ab2b5cc7bc85360467840dfce9 /lib/mako/codegen.py
parente7193c382cc9b8d73d68a446cace36a7661b7714 (diff)
downloadexternal_python_mako-a7889d1be5516f1ef6b46cc0dc54b01f39f07a33.tar.gz
external_python_mako-a7889d1be5516f1ef6b46cc0dc54b01f39f07a33.tar.bz2
external_python_mako-a7889d1be5516f1ef6b46cc0dc54b01f39f07a33.zip
- <%include> has an "args" attribute that can pass arguments to the called
template (keyword arguments only, must be declared in that page's <%page> tag.)
Diffstat (limited to 'lib/mako/codegen.py')
-rw-r--r--lib/mako/codegen.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/mako/codegen.py b/lib/mako/codegen.py
index 0621e27..9f05fb5 100644
--- a/lib/mako/codegen.py
+++ b/lib/mako/codegen.py
@@ -475,8 +475,12 @@ class _GenerateRenderMethod(object):
def visitIncludeTag(self, node):
self.write_source_comment(node)
- self.printer.writeline("runtime._include_file(context, %s, _template_uri)" % (node.parsed_attributes['file']))
-
+ args = node.attributes.get('args')
+ if args:
+ self.printer.writeline("runtime._include_file(context, %s, _template_uri, %s)" % (node.parsed_attributes['file'], args))
+ else:
+ self.printer.writeline("runtime._include_file(context, %s, _template_uri)" % (node.parsed_attributes['file']))
+
def visitNamespaceTag(self, node):
pass