Commit 291194e6 authored by Nicolas Delaby's avatar Nicolas Delaby

Maintain legacy interface without overkill conversion server.

It is not acceptable to call ooo backend twice just to return the mimetype
of the converted data that user explicity asked for.

Use mimetypes module instead.
(If it is not enough, API of cloudooo support a new method to 
return conversion and metadata extraction in unique call)





git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@44747 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f9b619a5
......@@ -263,14 +263,10 @@ class Manager(object):
# FIXME: Fast solution to obtain the html or pdf mimetypes
if zip:
response_dict['mime'] = "application/zip"
elif extension in ("html", "htm", "xhtml"):
elif extension == 'xhtml':
response_dict['mime'] = "text/html"
elif extension == "pdf":
response_dict['mime'] = "application/pdf"
else:
response_dict['mime'] = self.getFileMetadataItemList(
response_dict['data'],
extension)['MIMEType']
response_dict['mime'] = mimetypes.types_map.get('.%s' % extension)
return (200, response_dict, "")
except Exception, e:
logger.error(e)
......
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