#167: Apache/WSGI Integration
I modified the run_wsgi.py file to work directly in Apache to enable PHP-style pages written in Mako. I don't want to offend the purists :), but there are times when full app stacks like Pylons or...
View Article#150: Line ending handling broken on Win32 platform
Version 0.3.4 Line ending handling of templates is broken on Windows: For each "CR-LF" sequence in the template file you get "CR-CR-LF" in the output. This only happens when using the filename...
View Article#149: Add new filter "nbsp"
Hi, What do you think about adding a filter for non-breaking spaces? I assume that it could be very help full for a lot of people. Example:diff -r 4dc291a1bc1c mako/filters.py --- a/mako/filters.py...
View Article#197: "Try" blocks don't support the "else" ternary keyword.
parsetree.py:96 needs to be: 'try':set(['except','else','finally']), ...but I don't know enough about Mako internally to know what else (hehe) is required to make this work.
View Article#196: No way to import from __future__
<%! from __future__ import division %> on the first line of a file doesn't work, because the import doesn't end up as the first statement in the resulting Python module. Hardly a show-stopper,...
View Article#195: Control statements don't follow line-wrapping rules
% for item in [ 'some', 'long', 'list', 'of', 'items', ]: ${item} % endfor Produces: CompileException: Fragment 'for item in [' is not a partial control statement in file... Adding backslashes to the...
View Article#145: continue / break control statements?
Hi, I was wondering how to use control/break within a loop. I didn't find anything in the docs, so I tried this: % for i in range(10): % if i == 3: % continue % endif ${i} % endfor That didn't work,...
View Article#140: inconsistent behavior of filter pulling from context based on name
this is related to #3 but seems different frommako.templateimport Template x = Template(""" X: ${"asdf" | h.foo} """) y = Template(""" Y: ${"asdf" | z.foo} """) z = Template(""" Z: ${h} ${"asdf" |...
View Article#136: Suggestion: Custom Python message extractor in the Babel plugin
I use a gettext wrapper function with slightly modified semantics. I have written a Python message extractor for it, and now I would like to use the same extractor also in Mako. Would it be possible...
View Article#199: steal/port jinja2's debug.py exception rewriting logic
The mako-render render script is useful for rendering templates in a non-html environment (eg I use it to generate c++ code ...) It currently doesn't produce usable tracebacks when there is an error...
View Article#184: Template.render_context(context) (re)sets context['self']
I'm not quite positive that this is a bug, but I’m pretty sure it is. When Template.render_context() is called, it sets contextself?. So, if one renders another template like this:...
View Article#172: Clarify license in _ast_util.py
mako/_ast_util.py has the standard mako header at the top listing copyright holder as the mako authors and license terms as MIT. But the docstring that immediately follows says that the copyright...
View Article#171: default filters should be applied last
Maybe I am wrong here, but shouldn't default filters such as unicode() be applied last? The fact that it's done the exactly opposite way makes it a pain, as we are limited to deal with the...
View Article#168: variables implicitly passed to block cause unexpected error for def
Try out the following 3-level inheritance setup, stripped down to show only the situation I want to point out: Test setup: #base.mako: <%block name="foo"/> #middle.mako: <%inherit...
View Article#160: add source namespace to get_def() ?
When render() is called, runtime will pull out the requested namespace after _populate_self_namespace is called and effectively run whatever named def relative to that namespace, such as self. The...
View Article#111: mention defs can return data / better buffering explanation
Today I (finally) got how "buffering" works. I think documentation could do better at explaining how this things work behind mako scenes. First of all, all ${ call_some_function() } *should* be...
View Article#85: need to not call imp.load_source to work with GAE
Per a comment here: http://code.google.com/p/appengine-monkey/wiki/Pylons I was briefly confused by the following error: Error - <type 'exceptions.AttributeError'>: 'module' object has no...
View Article#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#198: no mention whatsoever of **pageargs in the inheritance chapter
ideally all the body() calls should have it
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#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