Commit c87b808a authored by Jérome Perrin's avatar Jérome Perrin

replace tabs by space, call the exception constructo before returning it.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11145 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5c3c9395
......@@ -90,12 +90,12 @@ class OOoBuilder:
except RuntimeError:
zf = ZipFile(self._document, mode='a')
try:
# remove the file first if it exists
fi = zf.getinfo(filename)
zf.filelist.remove( fi )
# remove the file first if it exists
fi = zf.getinfo(filename)
zf.filelist.remove( fi )
except KeyError:
# This is a new file
pass
# This is a new file
pass
zf.writestr(filename, stream)
zf.close()
......@@ -147,9 +147,6 @@ class OOoBuilder:
tal:attributes='dummy python:request.RESPONSE.setHeader("Content-Type", "text/html;; charset=utf-8")'
office:version='1.0'""")
"""
"""
security.declarePublic('addFileEntry')
def addFileEntry(self, full_path, media_type, content=None):
""" Add a file entry to the manifest and possibly is content """
......@@ -238,10 +235,10 @@ class OOoParser:
try:
oo_unzipped = ZipFile(file_descriptor, mode="r")
except:
raise CorruptedOOoFile
raise CorruptedOOoFile()
# Test the integrity of the file
if oo_unzipped.testzip() != None:
raise CorruptedOOoFile
raise CorruptedOOoFile()
# Get the filename
self.filename = file_descriptor.filename
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment