Changeset 59:7dcb4b335b38
- Timestamp:
- 08/21/08 02:08:56 (19 months ago)
- Author:
- Nicolas ?vrard <nicoe@…>
- Parents:
- 53:b5e24837a3ba (diff), 58:1180376ab3cf (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
- Branch:
- default
- Message:
-
Automated merge with file:///home/nicoe/projets/relatorio/openhex-branch
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r53
|
r59
|
|
| 35 | 35 | import genshi.output |
| 36 | 36 | from genshi.template import MarkupTemplate |
| | 37 | from relatorio.reporting import Report |
| 37 | 38 | |
| 38 | 39 | GENSHI_EXPR = re.compile(r'''((/)?(for|choose|otherwise|when|if|with)\s*(\s(\w+)=["'](.*)["']|$)|.*)''') |
| … |
… |
|
| 55 | 56 | class ImageHref: |
| 56 | 57 | |
| 57 | | def __init__(self, zipfile): |
| | 58 | def __init__(self, zipfile, context): |
| 58 | 59 | self.zip = zipfile |
| | 60 | self.context = context.copy() |
| | 61 | self.obj = self.context.pop('o') |
| 59 | 62 | |
| 60 | 63 | def __call__(self, expr, name): |
| 61 | 64 | bitstream, mimetype = expr |
| | 65 | if isinstance(bitstream, Report): |
| | 66 | bitstream = bitstream(self.obj, **self.context).render() |
| 62 | 67 | bitstream.seek(0) |
| 63 | 68 | file_content = bitstream.read() |
| … |
… |
|
| 275 | 280 | def generate(self, *args, **kwargs): |
| 276 | 281 | serializer = OOSerializer(self.filepath) |
| 277 | | kwargs['make_href'] = ImageHref(serializer.outzip) |
| | 282 | kwargs['make_href'] = ImageHref(serializer.outzip, kwargs) |
| 278 | 283 | generate_all = super(Template, self).generate(*args, **kwargs) |
| 279 | 284 | |
-
|
r58
|
r59
|
|
| 37 | 37 | from relatorio.reporting import Report |
| 38 | 38 | |
| 39 | | GENSHI_EXPR = re.compile(r'''((/)?(for|choose|otherwise|when|if|with)( (\w+)=["'](.*)["']|)|.*)''') |
| | 39 | GENSHI_EXPR = re.compile(r'''((/)?(for|choose|otherwise|when|if|with)\s*(\s(\w+)=["'](.*)["']|$)|.*)''') |
| 40 | 40 | EXTENSIONS = {'image/png': 'png', |
| 41 | 41 | 'image/jpeg': 'jpg', |