ezodf
ezodf copied to clipboard
Add support for Flat XML OpenDocumentFormat files
When I try to open a .odt file, I get:
>>> textproc = ezodf.opendoc("foo.fodt")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/ezodf/document.py", line 54, in opendoc
mime_type = __detect_mime_type(fm)
File "/usr/local/lib/python2.7/dist-packages/ezodf/document.py", line 69, in __detect_mime_type
mime_type = MIMETYPES[ext]
KeyError: '.fodt'
Same for .ods files
I think commit c96fe52dad92d62e3bd9c32e6b64393ec1ea55f8 introduced the issue. Before it checks first if provided file is a zip; after it checks first if filename is not None (and don't reach the flat xml test).
PR #23 solve the issue.