Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
cloudooo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
cloudooo
Commits
26a0394f
Commit
26a0394f
authored
May 20, 2024
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ooo: update mime mapper and tests for LibreOffice 7.6.
parent
25361606
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
27 deletions
+27
-27
cloudooo/handler/ooo/mimemapper.py
cloudooo/handler/ooo/mimemapper.py
+1
-1
cloudooo/handler/ooo/tests/testOooHandler.py
cloudooo/handler/ooo/tests/testOooHandler.py
+21
-21
cloudooo/handler/ooo/tests/testOooMimemapper.py
cloudooo/handler/ooo/tests/testOooMimemapper.py
+3
-3
cloudooo/handler/ooo/tests/testOooServer.py
cloudooo/handler/ooo/tests/testOooServer.py
+1
-1
cloudooo/manager.py
cloudooo/manager.py
+1
-1
No files found.
cloudooo/handler/ooo/mimemapper.py
View file @
26a0394f
...
@@ -94,7 +94,7 @@ class MimeMapper:
...
@@ -94,7 +94,7 @@ class MimeMapper:
'Microsoft PowerPoint 2007-2013 XML'
:
'ms.pptx'
,
'Microsoft PowerPoint 2007-2013 XML'
:
'ms.pptx'
,
'Microsoft Word 2007 XML'
:
'ms.docx'
,
'Microsoft Word 2007 XML'
:
'ms.docx'
,
'Microsoft Word 2007-2013 XML'
:
'ms.docx'
,
'Microsoft Word 2007-2013 XML'
:
'ms.docx'
,
'Word 2007
–365
'
:
'ms.docx'
,
'Word 2007'
:
'ms.docx'
,
'Microsoft Word 6.0'
:
'6.doc'
,
'Microsoft Word 6.0'
:
'6.doc'
,
'Microsoft Word 95'
:
'95.doc'
,
'Microsoft Word 95'
:
'95.doc'
,
'TIFF - Tagged Image File Format'
:
'tiff'
,
'TIFF - Tagged Image File Format'
:
'tiff'
,
...
...
cloudooo/handler/ooo/tests/testOooHandler.py
View file @
26a0394f
...
@@ -204,11 +204,11 @@ class TestHandler(HandlerTestCase):
...
@@ -204,11 +204,11 @@ class TestHandler(HandlerTestCase):
(
'application/msword'
,
'Word 97–2003'
),
(
'application/msword'
,
'Word 97–2003'
),
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/rtf'
,
'Rich Text'
),
(
'application/rtf'
,
'Rich Text'
),
(
'application/vnd.ms-word.document.macroEnabled.12'
,
'Word 2007
–365
VBA'
),
(
'application/vnd.ms-word.document.macroEnabled.12'
,
'Word 2007 VBA'
),
(
'application/vnd.oasis.opendocument.text'
,
'ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text'
,
'ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text-flat-xml'
,
'Flat XML ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text-flat-xml'
,
'Flat XML ODF Text Document'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'
Office Open XML Text (Transitional)
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'
Word 2007
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'Word 20
07–365
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'Word 20
10–365 Document
'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphics'
),
(
'image/png'
,
'PNG - Portable Network Graphics'
),
(
'image/webp'
,
'WEBP - WebP Image'
),
(
'image/webp'
,
'WEBP - WebP Image'
),
...
@@ -227,11 +227,11 @@ class TestHandler(HandlerTestCase):
...
@@ -227,11 +227,11 @@ class TestHandler(HandlerTestCase):
(
'application/msword'
,
'Word 97–2003'
),
(
'application/msword'
,
'Word 97–2003'
),
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/rtf'
,
'Rich Text'
),
(
'application/rtf'
,
'Rich Text'
),
(
'application/vnd.ms-word.document.macroEnabled.12'
,
'Word 2007
–365
VBA'
),
(
'application/vnd.ms-word.document.macroEnabled.12'
,
'Word 2007 VBA'
),
(
'application/vnd.oasis.opendocument.text'
,
'ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text'
,
'ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text-flat-xml'
,
'Flat XML ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text-flat-xml'
,
'Flat XML ODF Text Document'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'
Office Open XML Text (Transitional)
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'
Word 2007
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'Word 20
07–365
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'Word 20
10–365 Document
'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphics'
),
(
'image/png'
,
'PNG - Portable Network Graphics'
),
(
'image/webp'
,
'WEBP - WebP Image'
),
(
'image/webp'
,
'WEBP - WebP Image'
),
...
@@ -277,11 +277,11 @@ class TestHandler(HandlerTestCase):
...
@@ -277,11 +277,11 @@ class TestHandler(HandlerTestCase):
(
'application/msword'
,
'Word 97–2003'
),
(
'application/msword'
,
'Word 97–2003'
),
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/rtf'
,
'Rich Text'
),
(
'application/rtf'
,
'Rich Text'
),
(
'application/vnd.ms-word.document.macroEnabled.12'
,
'Word 2007
–365
VBA'
),
(
'application/vnd.ms-word.document.macroEnabled.12'
,
'Word 2007 VBA'
),
(
'application/vnd.oasis.opendocument.text'
,
'ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text'
,
'ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text-flat-xml'
,
'Flat XML ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text-flat-xml'
,
'Flat XML ODF Text Document'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'
Office Open XML Text (Transitional)
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'
Word 2007
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'Word 20
07–365
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'Word 20
10–365 Document
'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphics'
),
(
'image/png'
,
'PNG - Portable Network Graphics'
),
(
'image/webp'
,
'WEBP - WebP Image'
),
(
'image/webp'
,
'WEBP - WebP Image'
),
...
@@ -297,11 +297,11 @@ class TestHandler(HandlerTestCase):
...
@@ -297,11 +297,11 @@ class TestHandler(HandlerTestCase):
(
'application/msword'
,
'Word 97–2003'
),
(
'application/msword'
,
'Word 97–2003'
),
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/rtf'
,
'Rich Text'
),
(
'application/rtf'
,
'Rich Text'
),
(
'application/vnd.ms-word.document.macroEnabled.12'
,
'Word 2007
–365
VBA'
),
(
'application/vnd.ms-word.document.macroEnabled.12'
,
'Word 2007 VBA'
),
(
'application/vnd.oasis.opendocument.text'
,
'ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text'
,
'ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text-flat-xml'
,
'Flat XML ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text-flat-xml'
,
'Flat XML ODF Text Document'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'
Office Open XML Text (Transitional)
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'
Word 2007
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'Word 20
07–365
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'Word 20
10–365 Document
'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphics'
),
(
'image/png'
,
'PNG - Portable Network Graphics'
),
(
'image/webp'
,
'WEBP - WebP Image'
),
(
'image/webp'
,
'WEBP - WebP Image'
),
...
@@ -360,7 +360,7 @@ class TestHandler(HandlerTestCase):
...
@@ -360,7 +360,7 @@ class TestHandler(HandlerTestCase):
(
'application/rtf'
,
'Rich Text'
),
(
'application/rtf'
,
'Rich Text'
),
(
'application/vnd.ms-excel'
,
'Excel 97–2003'
),
(
'application/vnd.ms-excel'
,
'Excel 97–2003'
),
(
'application/vnd.ms-excel.sheet.macroEnabled.12'
,
'Excel 2007–365 (macro-enabled)'
),
(
'application/vnd.ms-excel.sheet.macroEnabled.12'
,
'Excel 2007–365 (macro-enabled)'
),
(
'application/vnd.ms-word.document.macroEnabled.12'
,
'Word 2007
–365
VBA'
),
(
'application/vnd.ms-word.document.macroEnabled.12'
,
'Word 2007 VBA'
),
(
'application/vnd.oasis.opendocument.spreadsheet'
,
'ODF Spreadsheet'
),
(
'application/vnd.oasis.opendocument.spreadsheet'
,
'ODF Spreadsheet'
),
(
'application/vnd.oasis.opendocument.spreadsheet-flat-xml'
,
'Flat XML ODF Spreadsheet'
),
(
'application/vnd.oasis.opendocument.spreadsheet-flat-xml'
,
'Flat XML ODF Spreadsheet'
),
(
'application/vnd.oasis.opendocument.text'
,
'ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text'
,
'ODF Text Document'
),
...
@@ -368,8 +368,8 @@ class TestHandler(HandlerTestCase):
...
@@ -368,8 +368,8 @@ class TestHandler(HandlerTestCase):
(
'application/vnd.oasis.opendocument.text-flat-xml'
,
'Flat XML ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text-flat-xml'
,
'Flat XML ODF Text Document'
),
(
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
,
'Excel 2007–365'
),
(
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
,
'Excel 2007–365'
),
(
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
,
'Office Open XML Spreadsheet'
),
(
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
,
'Office Open XML Spreadsheet'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'
Office Open XML Text (Transitional)
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'
Word 2007
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'Word 20
07–365
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'Word 20
10–365 Document
'
),
(
'application/vnd.sun.xml.writer'
,
'OpenOffice.org 1.0 Text Document (Writer/Web)'
),
(
'application/vnd.sun.xml.writer'
,
'OpenOffice.org 1.0 Text Document (Writer/Web)'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphics'
),
(
'image/png'
,
'PNG - Portable Network Graphics'
),
...
@@ -688,11 +688,11 @@ class TestHandler(HandlerTestCase):
...
@@ -688,11 +688,11 @@ class TestHandler(HandlerTestCase):
(
'application/msword'
,
'Word 97–2003'
),
(
'application/msword'
,
'Word 97–2003'
),
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/pdf'
,
'PDF - Portable Document Format'
),
(
'application/rtf'
,
'Rich Text'
),
(
'application/rtf'
,
'Rich Text'
),
(
'application/vnd.ms-word.document.macroEnabled.12'
,
'Word 2007
–365
VBA'
),
(
'application/vnd.ms-word.document.macroEnabled.12'
,
'Word 2007 VBA'
),
(
'application/vnd.oasis.opendocument.text'
,
'ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text'
,
'ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text-flat-xml'
,
'Flat XML ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text-flat-xml'
,
'Flat XML ODF Text Document'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'
Office Open XML Text (Transitional)
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'
Word 2007
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'Word 20
07–365
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'Word 20
10–365 Document
'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphics'
),
(
'image/png'
,
'PNG - Portable Network Graphics'
),
(
'image/webp'
,
'WEBP - WebP Image'
),
(
'image/webp'
,
'WEBP - WebP Image'
),
...
@@ -709,7 +709,7 @@ class TestHandler(HandlerTestCase):
...
@@ -709,7 +709,7 @@ class TestHandler(HandlerTestCase):
(
'application/rtf'
,
'Rich Text'
),
(
'application/rtf'
,
'Rich Text'
),
(
'application/vnd.ms-excel'
,
'Excel 97–2003'
),
(
'application/vnd.ms-excel'
,
'Excel 97–2003'
),
(
'application/vnd.ms-excel.sheet.macroEnabled.12'
,
'Excel 2007–365 (macro-enabled)'
),
(
'application/vnd.ms-excel.sheet.macroEnabled.12'
,
'Excel 2007–365 (macro-enabled)'
),
(
'application/vnd.ms-word.document.macroEnabled.12'
,
'Word 2007
–365
VBA'
),
(
'application/vnd.ms-word.document.macroEnabled.12'
,
'Word 2007 VBA'
),
(
'application/vnd.oasis.opendocument.spreadsheet'
,
'ODF Spreadsheet'
),
(
'application/vnd.oasis.opendocument.spreadsheet'
,
'ODF Spreadsheet'
),
(
'application/vnd.oasis.opendocument.spreadsheet-flat-xml'
,
'Flat XML ODF Spreadsheet'
),
(
'application/vnd.oasis.opendocument.spreadsheet-flat-xml'
,
'Flat XML ODF Spreadsheet'
),
(
'application/vnd.oasis.opendocument.text'
,
'ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text'
,
'ODF Text Document'
),
...
@@ -717,8 +717,8 @@ class TestHandler(HandlerTestCase):
...
@@ -717,8 +717,8 @@ class TestHandler(HandlerTestCase):
(
'application/vnd.oasis.opendocument.text-flat-xml'
,
'Flat XML ODF Text Document'
),
(
'application/vnd.oasis.opendocument.text-flat-xml'
,
'Flat XML ODF Text Document'
),
(
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
,
'Excel 2007–365'
),
(
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
,
'Excel 2007–365'
),
(
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
,
'Office Open XML Spreadsheet'
),
(
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
,
'Office Open XML Spreadsheet'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'
Office Open XML Text (Transitional)
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'
Word 2007
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'Word 20
07–365
'
),
(
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
'Word 20
10–365 Document
'
),
(
'application/vnd.sun.xml.writer'
,
'OpenOffice.org 1.0 Text Document (Writer/Web)'
),
(
'application/vnd.sun.xml.writer'
,
'OpenOffice.org 1.0 Text Document (Writer/Web)'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/jpeg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'image/png'
,
'PNG - Portable Network Graphics'
),
(
'image/png'
,
'PNG - Portable Network Graphics'
),
...
...
cloudooo/handler/ooo/tests/testOooMimemapper.py
View file @
26a0394f
...
@@ -36,12 +36,12 @@ from cloudooo.handler.ooo.mimemapper import MimeMapper
...
@@ -36,12 +36,12 @@ from cloudooo.handler.ooo.mimemapper import MimeMapper
# extension/document_type, the returned mime types are different for text
# extension/document_type, the returned mime types are different for text
text_expected_tuple
=
(
text_expected_tuple
=
(
(
'doc'
,
'Word 97–2003'
),
(
'doc'
,
'Word 97–2003'
),
(
'docx'
,
'
Office Open XML Text (Transitional)
'
),
(
'docx'
,
'
Word 2010–365 Document
'
),
(
'epub'
,
'EPUB Document'
),
(
'epub'
,
'EPUB Document'
),
(
'fodt'
,
'Flat XML ODF Text Document'
),
(
'fodt'
,
'Flat XML ODF Text Document'
),
(
'html'
,
'HTML Document (Writer)'
),
(
'html'
,
'HTML Document (Writer)'
),
(
'jpg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'jpg'
,
'JPEG - Joint Photographic Experts Group'
),
(
'ms.docx'
,
'Word 2007
–365
'
),
(
'ms.docx'
,
'Word 2007'
),
(
'odt'
,
'ODF Text Document'
),
(
'odt'
,
'ODF Text Document'
),
(
'pdf'
,
'PDF - Portable Document Format'
),
(
'pdf'
,
'PDF - Portable Document Format'
),
(
'png'
,
'PNG - Portable Network Graphics'
),
(
'png'
,
'PNG - Portable Network Graphics'
),
...
@@ -50,7 +50,7 @@ text_expected_tuple = (
...
@@ -50,7 +50,7 @@ text_expected_tuple = (
(
'webp'
,
'WEBP - WebP Image'
),
(
'webp'
,
'WEBP - WebP Image'
),
)
)
extra_text_expected_tuple
=
(
extra_text_expected_tuple
=
(
(
'docm'
,
'Word 2007
–365
VBA'
),
(
'docm'
,
'Word 2007 VBA'
),
)
)
global_expected_tuple
=
(
global_expected_tuple
=
(
...
...
cloudooo/handler/ooo/tests/testOooServer.py
View file @
26a0394f
...
@@ -52,7 +52,7 @@ class TestAllowedExtensions(TestCase):
...
@@ -52,7 +52,7 @@ class TestAllowedExtensions(TestCase):
text_allowed_list
=
self
.
proxy
.
getAllowedExtensionList
(
text_request
)
text_allowed_list
=
self
.
proxy
.
getAllowedExtensionList
(
text_request
)
# XXX slightly different allowed formats with document_type !?
# XXX slightly different allowed formats with document_type !?
_text_expected_tuple
=
text_expected_tuple
+
(
_text_expected_tuple
=
text_expected_tuple
+
(
(
'docm'
,
'Word 2007
–365
VBA'
),
(
'docm'
,
'Word 2007 VBA'
),
)
)
self
.
assertEqual
(
self
.
assertEqual
(
sorted
([
tuple
(
x
)
for
x
in
text_allowed_list
]),
sorted
([
tuple
(
x
)
for
x
in
text_allowed_list
]),
...
...
cloudooo/manager.py
View file @
26a0394f
...
@@ -84,7 +84,7 @@ def BBB_guess_extension(mimetype, title=None):
...
@@ -84,7 +84,7 @@ def BBB_guess_extension(mimetype, title=None):
"Microsoft PowerPoint 2007-2013 XML"
:
".ms.pptx"
,
"Microsoft PowerPoint 2007-2013 XML"
:
".ms.pptx"
,
"Microsoft PowerPoint 2007-2013 XML AutoPlay"
:
".ms.ppsx"
,
"Microsoft PowerPoint 2007-2013 XML AutoPlay"
:
".ms.ppsx"
,
"Microsoft Word 2007-2013 XML"
:
".ms.docx"
,
"Microsoft Word 2007-2013 XML"
:
".ms.docx"
,
"Word 2007
–365
"
:
".ms.docx"
,
"Word 2007"
:
".ms.docx"
,
}.
get
(
title
,
None
)
or
{
}.
get
(
title
,
None
)
or
{
# mediatype : extension
# mediatype : extension
"application/msword"
:
".doc"
,
"application/msword"
:
".doc"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment