Mercurial > piecrust2
comparison piecrust/rendering.py @ 7:343d08ef5668
More PieCrust 3 fixes, and a couple of miscellaneous bug fixes.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 16 Aug 2014 15:07:22 -0700 |
parents | 474c9882decf |
children | 30a42341cfa8 |
comparison
equal
deleted
inserted
replaced
6:f5ca5c5bed85 | 7:343d08ef5668 |
---|---|
1 import re | 1 import re |
2 import os.path | 2 import os.path |
3 import codecs | |
4 import logging | 3 import logging |
5 from piecrust.data.builder import (DataBuildingContext, build_page_data, | 4 from piecrust.data.builder import (DataBuildingContext, build_page_data, |
6 build_layout_data) | 5 build_layout_data) |
7 from piecrust.environment import PHASE_PAGE_FORMATTING, PHASE_PAGE_RENDERING | 6 from piecrust.environment import PHASE_PAGE_FORMATTING, PHASE_PAGE_RENDERING |
8 | 7 |
96 else: | 95 else: |
97 output = contents['content'] | 96 output = contents['content'] |
98 | 97 |
99 rp = RenderedPage(page, ctx.uri, ctx.page_num) | 98 rp = RenderedPage(page, ctx.uri, ctx.page_num) |
100 rp.data = page_data | 99 rp.data = page_data |
101 rp.content = codecs.encode(output, 'utf8') | 100 rp.content = output |
102 rp.execution_info = eis.current_page_info | 101 rp.execution_info = eis.current_page_info |
103 return rp | 102 return rp |
104 finally: | 103 finally: |
105 eis.popPage() | 104 eis.popPage() |
106 | 105 |