Mercurial > piecrust2
comparison piecrust/rendering.py @ 427:3b658190c02b
performance: Compute default layout extensions only once.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Fri, 26 Jun 2015 09:51:06 -0700 |
parents | 6801ad5aa1d4 |
children | 21e26ed867b6 |
comparison
equal
deleted
inserted
replaced
426:ed5ccd4cce49 | 427:3b658190c02b |
---|---|
340 cpi = page.app.env.exec_info_stack.current_page_info | 340 cpi = page.app.env.exec_info_stack.current_page_info |
341 assert cpi is not None | 341 assert cpi is not None |
342 assert cpi.page == page | 342 assert cpi.page == page |
343 | 343 |
344 names = layout_name.split(',') | 344 names = layout_name.split(',') |
345 default_template_engine = get_template_engine(page.app, None) | 345 default_exts = page.app.env.default_layout_extensions |
346 default_exts = ['.' + e.lstrip('.') | |
347 for e in default_template_engine.EXTENSIONS] | |
348 full_names = [] | 346 full_names = [] |
349 for name in names: | 347 for name in names: |
350 if '.' not in name: | 348 if '.' not in name: |
351 for ext in default_exts: | 349 for ext in default_exts: |
352 full_names.append(name + ext) | 350 full_names.append(name + ext) |