This commit is contained in:
Gaetan Delannay 2014-06-23 19:18:05 +02:00
parent f7eaed817e
commit c676d0b29c
2 changed files with 8 additions and 6 deletions

View file

@ -574,7 +574,8 @@ class MemoryBuffer(Buffer):
def getElementIndexes(self, expressions=True): def getElementIndexes(self, expressions=True):
res = [] res = []
for index, elem in self.elements.iteritems(): for index, elem in self.elements.iteritems():
condition = isinstance(elem, Expression) condition = isinstance(elem, Expression) or \
isinstance(elem, Attributes)
if not expressions: if not expressions:
condition = not condition condition = not condition
if condition: if condition:

View file

@ -127,11 +127,11 @@ class Renderer:
specify a styles mapping in p_stylesMapping. specify a styles mapping in p_stylesMapping.
- If you specify a function in p_finalizeFunction, this function will - If you specify a function in p_finalizeFunction, this function will
be called by the renderer before re-zipping the ODT result. This way, be called by the renderer before re-zipping the ODT/S result. This
you can still perform some actions on the content of the ODT file way, you can still perform some actions on the content of the ODT/S
before it is zipped and potentially converted. This function must file before it is zipped and potentially converted. This function
accept one arg: the absolute path to the temporary folder containing must accept one arg: the absolute path to the temporary folder
the un-zipped content of the ODT result. containing the un-zipped content of the ODT/S result.
- If you set p_overwriteExisting to True, the renderer will overwrite - If you set p_overwriteExisting to True, the renderer will overwrite
the result file. Else, an exception will be thrown if the result file the result file. Else, an exception will be thrown if the result file
@ -195,6 +195,7 @@ class Renderer:
if fileName: if fileName:
fullFileName = os.path.join(fullFolderName, fileName) fullFileName = os.path.join(fullFolderName, fileName)
f = open(fullFileName, 'wb') f = open(fullFileName, 'wb')
print fullFileName
fileContent = self.templateZip.read(zippedFile) fileContent = self.templateZip.read(zippedFile)
if (fileName == 'content.xml') and not folderName: if (fileName == 'content.xml') and not folderName:
# content.xml files may reside in subfolders. # content.xml files may reside in subfolders.