Mercurial > piecrust2
comparison piecrust/rendering.py @ 904:cc2647360036
internal: Remove unnecessary timer, add timer for lazy data building.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 23 Jul 2017 08:25:45 -0700 |
parents | d6d35b2efd04 |
children | f2b75e4be981 |
comparison
equal
deleted
inserted
replaced
903:812ca80863d4 | 904:cc2647360036 |
---|---|
282 _unpickle_object(render_result['pass_info'])) | 282 _unpickle_object(render_result['pass_info'])) |
283 return rs | 283 return rs |
284 | 284 |
285 | 285 |
286 def _build_render_data(ctx): | 286 def _build_render_data(ctx): |
287 with ctx.app.env.stats.timerScope("PageDataBuild"): | 287 data_ctx = DataBuildingContext(ctx.page, ctx.sub_num) |
288 data_ctx = DataBuildingContext(ctx.page, ctx.sub_num) | 288 data_ctx.pagination_source = ctx.pagination_source |
289 data_ctx.pagination_source = ctx.pagination_source | 289 data_ctx.pagination_filter = ctx.pagination_filter |
290 data_ctx.pagination_filter = ctx.pagination_filter | 290 page_data = build_page_data(data_ctx) |
291 page_data = build_page_data(data_ctx) | 291 if ctx.custom_data: |
292 if ctx.custom_data: | 292 page_data._appendMapping(ctx.custom_data) |
293 page_data._appendMapping(ctx.custom_data) | 293 return page_data |
294 return page_data | |
295 | 294 |
296 | 295 |
297 def _do_render_page_segments_from_ctx(ctx): | 296 def _do_render_page_segments_from_ctx(ctx): |
298 page_data = _build_render_data(ctx) | 297 page_data = _build_render_data(ctx) |
299 return _do_render_page_segments(ctx, page_data) | 298 return _do_render_page_segments(ctx, page_data) |