1
0
mirror of synced 2024-11-22 09:14:23 +01:00

Support even more libreoffice files

This commit is contained in:
jvoisin 2018-03-31 21:22:16 +02:00
parent 12b3b39d4d
commit 88fcd4071d

View File

@ -11,6 +11,10 @@ from . import abstract, parser_factory
class LibreOfficeParser(abstract.AbstractParser): class LibreOfficeParser(abstract.AbstractParser):
mimetypes = { mimetypes = {
'application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.text',
'application/vnd.oasis.opendocument.spreadsheet',
'application/vnd.oasis.opendocument.presentation',
'application/vnd.oasis.opendocument.graphics',
'application/vnd.oasis.opendocument.chart'
} }
def get_meta(self): def get_meta(self):
@ -39,7 +43,7 @@ class LibreOfficeParser(abstract.AbstractParser):
if item.filename[-1] == '/': if item.filename[-1] == '/':
continue # `is_dir` is added in Python3.6 continue # `is_dir` is added in Python3.6
elif item.filename == 'meta.xml': elif item.filename == 'meta.xml':
continue # don't keep metadata files continue # don't keep metadata files
zin.extract(member=item, path=temp_folder) zin.extract(member=item, path=temp_folder)
tmp_parser = parser_factory.get_parser(os.path.join(temp_folder, item.filename)) tmp_parser = parser_factory.get_parser(os.path.join(temp_folder, item.filename))