Skip to content
Myr

[svn] simplified code that calculates the import filename

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent f750daa · Browse files · 3 files+5 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+5 added−2 removed

  • tests:+3 added−0 removed
  • other:+2 added−2 removed

3 files+5 added−2 removed

modified:jinja/loaders.py+2 added-2 removed
27 unmodified lines
28def get_template_filename(searchpath, name):29 """30 Return the filesystem filename wanted.31 """32 return path.join(searchpath, path.sep.join([p for p in name.split('/')33 if p and p[0] != '.']))32 return path.join(searchpath, *[p for p in name.split('/')33 if p and p[0] != '.'])343536def get_cachename(cachepath, name, salt=None):37 """
486 unmodified lines
added:tests/loaderres/templates/foo/test.html+1 added
modified:tests/test_loaders.py+2 added
56 unmodified lines
57def test_filesystem_loader():58 env = Environment(loader=filesystem_loader)59 tmpl = env.get_template('test.html')60 assert tmpl.render().strip() == 'BAR'61 tmpl = env.get_template('foo/test.html')62 assert tmpl.render().strip() == 'FOO'63 try:64 env.get_template('missing.html')65 except TemplateNotFound:66 pass
82 unmodified lines