Show
Ignore:
Timestamp:
08/21/08 02:08:56 (2 years 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

Location:
relatorio/templates/opendocument.py
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • relatorio/templates/opendocument.py

    r53 r59  
    3535import genshi.output 
    3636from genshi.template import MarkupTemplate 
     37from relatorio.reporting import Report 
    3738 
    3839GENSHI_EXPR = re.compile(r'''((/)?(for|choose|otherwise|when|if|with)\s*(\s(\w+)=["'](.*)["']|$)|.*)''') 
     
    5556class ImageHref: 
    5657     
    57     def __init__(self, zipfile): 
     58    def __init__(self, zipfile, context): 
    5859        self.zip = zipfile 
     60        self.context = context.copy() 
     61        self.obj = self.context.pop('o') 
    5962 
    6063    def __call__(self, expr, name): 
    6164        bitstream, mimetype = expr 
     65        if isinstance(bitstream, Report): 
     66            bitstream = bitstream(self.obj, **self.context).render() 
    6267        bitstream.seek(0) 
    6368        file_content = bitstream.read() 
     
    275280    def generate(self, *args, **kwargs): 
    276281        serializer = OOSerializer(self.filepath) 
    277         kwargs['make_href'] = ImageHref(serializer.outzip) 
     282        kwargs['make_href'] = ImageHref(serializer.outzip, kwargs) 
    278283        generate_all = super(Template, self).generate(*args, **kwargs) 
    279284 
  • relatorio/templates/opendocument.py

    r58 r59  
    3737from relatorio.reporting import Report 
    3838 
    39 GENSHI_EXPR = re.compile(r'''((/)?(for|choose|otherwise|when|if|with)( (\w+)=["'](.*)["']|)|.*)''') 
     39GENSHI_EXPR = re.compile(r'''((/)?(for|choose|otherwise|when|if|with)\s*(\s(\w+)=["'](.*)["']|$)|.*)''') 
    4040EXTENSIONS = {'image/png': 'png', 
    4141              'image/jpeg': 'jpg',