Skip to content

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

Closed

Description

@sqlalchemy-bot

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

Activity

  1. sqlalchemy-bot commented on Jun 30, 2010

    @sqlalchemy-bot
    Author

    Michael Bayer (@zzzeek) wrote:

    4b408e5

  2. sqlalchemy-bot commented on Jun 30, 2010

    @sqlalchemy-bot
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions