Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tristan Cavelier
erp5
Commits
e4413072
Commit
e4413072
authored
Jan 04, 2017
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xxx asc+zip
parent
150de840
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
product/ERP5OOo/Document/OOoDocument.py
product/ERP5OOo/Document/OOoDocument.py
+10
-9
No files found.
product/ERP5OOo/Document/OOoDocument.py
View file @
e4413072
...
...
@@ -297,18 +297,18 @@ class OOoDocument(OOoDocumentExtensibleTraversableMixin, BaseConvertableFileMixi
##### BEGIN hack - handle yformat (should not be OOoDocument) XXX##
# XXX public cloudooo.erp5.net cannot handle x2t because of an OSError
__traceback_info__ = ("orig_format", orig_format, "format", format)
if format in ("docy", "application/x-asc-text"):
if format in ("docy", "application/x-asc-text
+zip", "application/x-asc-text
"):
encdata = server_proxy.convertFile(enc(str(self.getBaseData())), "odt", "docx")
#orig_format = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
return "application/x-asc-text", Pdata(dec(server_proxy.convertFile(encdata, "docx", "docy")))
if format in ("xsly", "application/x-asc-spreadsheet"):
return "application/x-asc-text", Pdata(dec(server_proxy.convertFile(encdata, "docx", "docy")))
# XXX change to application/x-asc-*+zip ?
if format in ("xsly", "application/x-asc-spreadsheet
+zip", "application/x-asc-spreadsheet
"):
encdata = server_proxy.convertFile(enc(str(self.getBaseData())), "ods", "xlsx")
#orig_format = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
return "application/x-asc-spreadsheet", Pdata(dec(server_proxy.convertFile(encdata, "xlsx", "xlsy")))
if format in ("ppty", "application/x-asc-presentation"):
return "application/x-asc-spreadsheet", Pdata(dec(server_proxy.convertFile(encdata, "xlsx", "xlsy")))
# XXX change to application/x-asc-*+zip ?
if format in ("ppty", "application/x-asc-presentation
+zip", "application/x-asc-presentation
"):
encdata = server_proxy.convertFile(enc(str(self.getBaseData())), "odp", "pptx")
#orig_format = "application/vnd.openxmlformats-officedocument.presentationml.presentation"
return "application/x-asc-presentation", Pdata(dec(server_proxy.convertFile(encdata, "pptx", "ppty")))
return "application/x-asc-presentation", Pdata(dec(server_proxy.convertFile(encdata, "pptx", "ppty")))
# XXX change to application/x-asc-*+zip ?
##### END hack #####
generate_result = server_proxy.run_generate(self.getId(),
enc(str(self.getBaseData())),
...
...
@@ -404,6 +404,7 @@ class OOoDocument(OOoDocumentExtensibleTraversableMixin, BaseConvertableFileMixi
has_format
=
self
.
hasConversion
(
format
=
original_format
,
**
kw
)
if
not
has_format
:
# Do real conversion
# XXX think -> mime, data = self._getConversionFromPortalTransform(format)
mime
,
data
=
self
.
_getConversionFromProxyServer
(
format
)
if
is_html
:
# Extra processing required since
...
...
@@ -494,15 +495,15 @@ class OOoDocument(OOoDocumentExtensibleTraversableMixin, BaseConvertableFileMixi
##### BEGIN hack - handle yformat (which should not be OOoDocument) XXX##
content_type
=
self
.
getContentType
()
filename
=
self
.
getFilename
()
or
self
.
getId
()
if
content_type
==
"application/x-asc-text"
:
if
content_type
in
(
"application/x-asc-text+zip"
,
"application/x-asc-text"
)
:
encdata
=
server_proxy
.
convertFile
(
enc
(
str
(
self
.
getData
())),
"docy"
,
"docx"
)
content_type
=
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
filename
+=
".docx"
elif
content_type
==
"application/x-asc-spreadsheet"
:
elif
content_type
in
(
"application/x-asc-spreadsheet+zip"
,
"application/x-asc-spreadsheet"
)
:
encdata
=
server_proxy
.
convertFile
(
enc
(
str
(
self
.
getData
())),
"xlsy"
,
"xlsx"
)
content_type
=
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
filename
+=
".xlsx"
elif
content_type
==
"application/x-asc-presentation"
:
elif
content_type
in
(
"application/x-asc-presentation+zip"
,
"application/x-asc-presentation"
)
:
encdata
=
server_proxy
.
convertFile
(
enc
(
str
(
self
.
getData
())),
"ppty"
,
"pptx"
)
content_type
=
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
filename
+=
".pptx"
...
...
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