diff --git a/CHANGES b/CHANGES index 62b7d7d4ce33754e5bda300613a0d240e8a1c038..ac42c4f5aabe05c684f465d8fbe0b136cfd7932d 100644 --- a/CHANGES +++ b/CHANGES @@ -9,9 +9,12 @@ propigates __nonzero__ method so it evaulates to False if not present, True otherwise. this way you can say % if caller:\n ${caller.body()}\n% endif - <%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.) +- <%include> plus arguments is also programmatically available via +self.include_file(<filename>, **kwargs) - further escaping added for multibyte expressions in %def, %call attributes [ticket:24] + 0.1.3 - ***Small Syntax Change*** - the single line comment character is now *two* hash signs, i.e. "## this is a comment". This avoids a common diff --git a/lib/mako/runtime.py b/lib/mako/runtime.py index fa9403e35f02ad90f38c7f008dc64f2b1b25dd83..bf1f7a0b61d6510a5f18c10d0b055c7f9cfe26bb 100644 --- a/lib/mako/runtime.py +++ b/lib/mako/runtime.py @@ -158,9 +158,9 @@ class Namespace(object): kwargs.setdefault('type', self.template.cache_type) return self.template.module._template_cache.get(key, **kwargs) - def include_file(self, uri): + def include_file(self, uri, **kwargs): """include a file at the given uri""" - _include_file(self.context, uri, self._templateuri) + _include_file(self.context, uri, self._templateuri, **kwargs) def _populate(self, d, l): for ident in l: