Skip to content
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
Closed

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

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

Comments

@sqlalchemy-bot
Copy link

@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
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Jun 30, 2010

Michael Bayer (@zzzeek) wrote:

4b408e5

@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant