Mercurial > piecrust2
comparison piecrust/app.py @ 415:0e9a94b7fdfa
bake: Improve bake record information.
* Store things in the bake record that require less interaction between the
master process and the workers. For instance, don't store the paginator
object in the render pass info -- instead, just store whether pagination
was used, and whether it had more items.
* Simplify information passing between workers and bake passes by saving the
rendering info to the JSON cache. This means the "render first sub" job
doesn't have to return anything except errors now.
* Add more performance counter info.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 20 Jun 2015 19:23:16 -0700 |
parents | e7b865f8f335 |
children | 6801ad5aa1d4 |
comparison
equal
deleted
inserted
replaced
414:c4b3a7fd2f87 | 415:0e9a94b7fdfa |
---|---|
27 | 27 |
28 | 28 |
29 logger = logging.getLogger(__name__) | 29 logger = logging.getLogger(__name__) |
30 | 30 |
31 | 31 |
32 CACHE_VERSION = 19 | 32 CACHE_VERSION = 20 |
33 | 33 |
34 | 34 |
35 class VariantNotFoundError(Exception): | 35 class VariantNotFoundError(Exception): |
36 def __init__(self, variant_path, message=None): | 36 def __init__(self, variant_path, message=None): |
37 super(VariantNotFoundError, self).__init__( | 37 super(VariantNotFoundError, self).__init__( |
411 | 411 |
412 self.env = env | 412 self.env = env |
413 if self.env is None: | 413 if self.env is None: |
414 self.env = StandardEnvironment() | 414 self.env = StandardEnvironment() |
415 self.env.initialize(self) | 415 self.env.initialize(self) |
416 | |
417 self.env.registerTimer('SiteConfigLoad') | 416 self.env.registerTimer('SiteConfigLoad') |
418 self.env.registerTimer('PageLoad') | 417 self.env.registerTimer('PageLoad') |
419 for engine in self.plugin_loader.getTemplateEngines(): | |
420 self.env.registerTimer(engine.__class__.__name__) | |
421 for fmt in self.plugin_loader.getFormatters(): | |
422 self.env.registerTimer(fmt.__class__.__name__) | |
423 | 418 |
424 @cached_property | 419 @cached_property |
425 def config(self): | 420 def config(self): |
426 logger.debug("Creating site configuration...") | 421 logger.debug("Creating site configuration...") |
427 start_time = time.perf_counter() | 422 start_time = time.perf_counter() |