#52: document dynamic inheritance
the template: <%inherit file="${layout}"/> the problem: NameError?: global name 'layout' is not defined when replacing the <%inherit %> with ${layout} the proper layout string is displayed...
View Article#17: More descriptive error message when missing required arguments for a...
When a template takes an argument like <%page args="x" /> and x is not provided, it yields the following error: exceptions.TypeError?: render_body() takes exactly 2 arguments (1 given) I think...
View Article#203: "Too many open files" error
Hi, I had a "too many open files" error (line 150 in template.py, _compile_from_file module). I patched template.py and problem seems to be solved I give you the patch (it seems that files are not...
View Article#202: mako-render doesn't give the lead template filesystem context.
scripts/mako-render a b 11#!/usr/bin/env python 22 3 def render(data, kw): 3def render(data, filename, kw): 44 from mako.template import Template 55 from mako.lookup import TemplateLookup 66 77...
View Article#200: running setup.py/2to3 changes unicode() to str() making code invalid
setup.py distributed with mako runs 2to3 by default on systems with python3. 2to3 automatically changes unicode() to str() making some of the places where unicode() appears incorrect. i.e. filters.py...
View Article#198: no mention whatsoever of **pageargs in the inheritance chapter
ideally all the body() calls should have it
View Article#194: mako/util.py error with exceptions
Hello Everyone, I'm trying to create a plugin for mako but i'm recieving errors: http://i.imgur.com/yAUeG.png looking inside mako/util.py I'm not able to found where is importing exceptions"
View Article#187: py3fication of babelplugin
File ".../Mako-0.6.2-py3.2.egg/mako/ext/babelplugin.py", line 115, in extract_nodes code = StringIO(code) TypeError: initial_value must be str or None, not bytes attached patch removes this problem.
View Article#207: Can't import * from python modules
<%namespace module="myapp.blah" import="*"/> seems to do dir(myapp.blah), which picks up everything in that module (variables, imported modules), not just functions. It then dies on...
View Article#211: Enhancing documentation about filters
Mako provide cool filters, but I think documentation can be enhanced explaining, in HTML, where to use which filter. I mean, how to filter this : ${val1} <${val2} src="${val3}"/> I was searching...
View Article#210: Missing documentation about parameters of render()
I'm searching if render can take an "object" like with properties, of a "dict" like with values, or only parameters, and I can't find it in the documentation, I think it's a cool thing to add.
View Article#215: warn/raise when a def/block is named "body"
Hi, I was trying out mako and found a peculiar issue. If I have the name of a block as "body" the inheritance won't work. I am attaching the output of before and after ... this is a very simple...
View Article#218: Allow control statements (if, else, endif, etc.) to be closed so they...
In line with the discussion here: http://groups.google.com/group/mako-discuss/browse_thread/thread/835ab6db0bb0cdb4 The pertinent parts quoted: However, if the case is that Jinja2's (% if...
View Article#217: Idea: local variable caching of filters/filter stacks
Analyzing the generated .py files from my current project, there's lots of this pattern, as my default_filters are ['h', 'unicode']: __M_writer(unicode(filters.html_escape(x)))...
View Article#219: Context.locals_() does not update the returned Context's `kwargs`...
unit test: classContextTest(unittest.TestCase):deftest_locals_kwargs(self): c = Context(None, foo='bar')self.assertEqual(c.kwargs,{'foo':'bar'}) d =...
View Article#220: extract_messages fails on backslash-escaped quotes at the end of a string
If a translation string ends in an escaped quote (\") or apostrophe (\) the message extractors will throw an error. Repro case: Create a mako template containing this: ${_("\"")} ${_('\'')} Set up...
View Article#222: Dict can not be passed to a function when using the “custom tag” format
A SyntaxError? (unexpected EOF) is raised when trying to pass a dict. <%form:form id="service-form" action="${request.current_route_url(action='update')}" buttons="${False}" data_attrs="${...
View Article#223: TGPlugin.render method doesn't support unicode template names
Traceback (most recent call last): File "/Users/vm/ws/mako/test/test_tgplugin.py", line 48,in test_render assert result_lines(tl.render({}, template=u'/index.html'))==[ File...
View Article