Changeset 84:54b0d747e492
- Timestamp:
- 11/20/08 01:17:19 (16 months ago)
- Author:
- Nicolas ?vrard <nicoe@…>
- Branch:
- default
- Message:
-
Support chart templates in ImageHref?
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r82
|
r84
|
|
| 37 | 37 | from relatorio.templates.base import RelatorioStream |
| 38 | 38 | from relatorio.reporting import Report, MIMETemplateLoader |
| | 39 | try: |
| | 40 | from relatorio.templates.chart import Template as ChartTemplate |
| | 41 | except ImportError: |
| | 42 | ChartTemplate = type(None) |
| 39 | 43 | |
| 40 | 44 | GENSHI_EXPR = re.compile(r'''((/)?(for|choose|otherwise|when|if|with)\s*(\s(\w+)=["'](.*)["']|$)|.*)''') |
| … |
… |
|
| 71 | 75 | if isinstance(bitstream, Report): |
| 72 | 76 | bitstream = bitstream(**self.context).render() |
| | 77 | elif isinstance(bitstream, ChartTemplate): |
| | 78 | bitstream = bitstream.generate(**self.context).render() |
| 73 | 79 | bitstream.seek(0) |
| 74 | 80 | file_content = bitstream.read() |
| … |
… |
|
| 270 | 276 | dico = "{'%s': %s, '%s': guess_type(%s)}" |
| 271 | 277 | parent.attrib[attrib_name] = dico % (office_name, expr, |
| 272 | | office_valuetype, |
| 273 | | expr) |
| | 278 | office_valuetype, expr) |
| 274 | 279 | parent.attrib.pop(office_valuetype, None) |
| 275 | 280 | parent.attrib.pop(office_name, None) |