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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Vincent Bechu
cloudooo
Commits
42fb4ec9
Commit
42fb4ec9
authored
Jan 20, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x2t: getAllowedConversionFormatList return OnlyOffice types too
1
parent
d1edf0f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
10 deletions
+18
-10
cloudooo/handler/x2t/handler.py
cloudooo/handler/x2t/handler.py
+18
-10
No files found.
cloudooo/handler/x2t/handler.py
View file @
42fb4ec9
...
...
@@ -204,17 +204,25 @@ class Handler(object):
...
]
"""
get_format_list
=
OOoHandler
.
getAllowedConversionFormatList
source_mimetype
=
parseContentType
(
source_mimetype
).
gettype
()
if
source_mimetype
in
(
"docx"
,
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
):
return
[(
"application/x-asc-text"
,
"OnlyOffice Text Document"
)]
if
source_mimetype
in
(
"docy"
,
"application/x-asc-text"
):
return
[(
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
,
"Word 2007 Document"
)]
if
source_mimetype
in
(
"xlsx"
,
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
):
return
[(
"application/x-asc-spreadsheet"
,
"OnlyOffice Spreadsheet"
)]
return
get_format_list
(
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
)
if
source_mimetype
in
(
"xlsy"
,
"application/x-asc-spreadsheet"
):
return
[(
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
,
"Excel 2007 Spreadsheet"
)]
if
source_mimetype
in
(
"pptx"
,
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
):
return
[(
"application/x-asc-presentation"
,
"OnlyOffice Presentation"
)]
return
get_format_list
(
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
)
if
source_mimetype
in
(
"ppty"
,
"application/x-asc-presentation"
):
return
[(
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
,
"PowerPoint 2007 Presentation"
)]
return
[]
return
get_format_list
(
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
)
format_list
=
get_format_list
(
source_mimetype
)
format_list_append
=
format_list
.
append
for
f_type
,
_
in
format_list
:
if
f_type
==
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
:
format_list_append
((
"application/x-asc-text"
,
"OnlyOffice Text Document"
))
break
if
f_type
==
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
:
format_list_append
((
"application/x-asc-spreadsheet"
,
"OnlyOffice Spreadsheet"
))
break
if
f_type
==
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
:
format_list_append
((
"application/x-asc-presentation"
,
"OnlyOffice Presentation"
))
break
return
format_list
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