[pod] Bugfix: error when a pod template does not have a 'mimetype' file inside (https://bugs.launchpad.net/bugs/1173009); bugfix: error when parsing some ods pod templates: some cells do not have attribute 'office:value-type' (see bug https://bugs.launchpad.net/bugs/1173301). [gen] Added a basic integration of gen applications with Google Analytics.
This commit is contained in:
parent
1c3555fd28
commit
a94d400d03
7 changed files with 40 additions and 2 deletions
|
@ -248,6 +248,7 @@ class PodParser(OdfParser):
|
|||
e.exprHasStyle = False
|
||||
elif (elem == e.tags['table-cell']) and \
|
||||
attrs.has_key(e.tags['formula']) and \
|
||||
attrs.has_key(e.tags['value-type']) and \
|
||||
(attrs[e.tags['value-type']] == 'string') and \
|
||||
attrs[e.tags['formula']].startswith('of:="'):
|
||||
# In an ODS template, any cell containing a formula of type "string"
|
||||
|
|
|
@ -540,8 +540,13 @@ class Renderer:
|
|||
# Linux/Unix, are unable to detect the correct mimetype for a pod result
|
||||
# (it simply recognizes it as a "application/zip" and not a
|
||||
# "application/vnd.oasis.opendocument.text)".
|
||||
resultZip.write(os.path.join(self.unzipFolder, 'mimetype'),
|
||||
'mimetype', zipfile.ZIP_STORED)
|
||||
mimetypeFile = os.path.join(self.unzipFolder, 'mimetype')
|
||||
# This file may not exist (presumably, ods files from Google Drive)
|
||||
if not os.path.exists(mimetypeFile):
|
||||
f = open(mimetypeFile, 'w')
|
||||
f.write(mimeTypes[resultExt])
|
||||
f.close()
|
||||
resultZip.write(mimetypeFile, 'mimetype', zipfile.ZIP_STORED)
|
||||
for dir, dirnames, filenames in os.walk(self.unzipFolder):
|
||||
for f in filenames:
|
||||
folderName = dir[len(self.unzipFolder)+1:]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue