Changeset 100:33521906fedb for relatorio/templates/opendocument.py
- Timestamp:
- 01/22/09 09:00:37 (19 months ago)
- Children:
- 102:91c56813903c, 103:6153a53efa40
- Branch:
- default
- Files:
-
- 1 modified
-
relatorio/templates/opendocument.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
relatorio/templates/opendocument.py
r99 r100 23 23 import re 24 24 import md5 25 import time 25 26 import urllib 26 27 import zipfile … … 401 402 # find the position in the row of the cells holding the 402 403 # <for> and </for> instructions 403 # XXX: count cells only instead of * ?404 # We use "*" so as to count both normal cells and covered/hidden cells 404 405 position_xpath_expr = 'count(preceding-sibling::*)' 405 406 opening_pos = \ … … 621 622 files.setdefault(stream_for, []).append((kind, data, pos)) 622 623 624 now = time.localtime()[:6] 623 625 for f_info in self.inzip.infolist(): 624 626 if f_info.filename.startswith('ObjectReplacements'): … … 626 628 elif f_info.filename in files: 627 629 stream = files[f_info.filename] 628 self.outzip.writestr(f_info.filename, 629 output_encode(self.xml_serializer(stream))) 630 # create a new file descriptor, copying some attributes from 631 # the original file 632 new_info = zipfile.ZipInfo(f_info.filename, now) 633 for attr in ('compress_type', 'flag_bits', 'create_system'): 634 setattr(new_info, attr, getattr(f_info, attr)) 635 serialized_stream = output_encode(self.xml_serializer(stream)) 636 self.outzip.writestr(new_info, serialized_stream) 630 637 else: 631 638 self.outzip.writestr(f_info, self.inzip.read(f_info.filename))
