New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support expression substitution for <%namespace /> file #141

Closed
sqlalchemy-bot opened this Issue Jun 29, 2010 · 2 comments

Comments

Projects
None yet
1 participant
@sqlalchemy-bot

sqlalchemy-bot commented Jun 29, 2010

Migrated issue, originally created by Anonymous

from mako.template import Template
from mako.lookup import TemplateLookup
from mako.exceptions import TemplateLookupException

l = TemplateLookup()

l.put_string('x', """
X:
    <%include file="${file}" />
""")

l.put_string('y', """
Y:
    <%namespace name="ns" file="${file}" />

    ${ns.body()}
""")

l.put_string('z', """
Z:
""")

print l.get_template('x').render(file='z')

try:
    print l.get_template('y').render(file='z')
except TemplateLookupException, e:
    print e
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Jun 30, 2010

Michael Bayer (@zzzeek) wrote:

4b408e5

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Jun 30, 2010

Changes by Michael Bayer (@zzzeek):

  • removed labels: bug
  • added labels: feature
  • changed status to closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment