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
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
Jérome Perrin
erp5
Commits
4cf7ca39
Commit
4cf7ca39
authored
Oct 10, 2022
by
Kazuhiko Shiozaki
Committed by
Arnaud Fontaine
Mar 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py2/py3: OOo data is binary.
parent
aa032a02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
product/ERP5OOo/OOoUtils.py
product/ERP5OOo/OOoUtils.py
+4
-3
No files found.
product/ERP5OOo/OOoUtils.py
View file @
4cf7ca39
...
@@ -49,6 +49,7 @@ from lxml import etree
...
@@ -49,6 +49,7 @@ from lxml import etree
from
lxml.etree
import
Element
,
XMLSyntaxError
from
lxml.etree
import
Element
,
XMLSyntaxError
from
copy
import
deepcopy
from
copy
import
deepcopy
from
warnings
import
warn
from
warnings
import
warn
from
Products.ERP5Type.Utils
import
bytes2str
class
CorruptedOOoFile
(
Exception
):
pass
class
CorruptedOOoFile
(
Exception
):
pass
...
@@ -137,7 +138,7 @@ class OOoBuilder(Implicit):
...
@@ -137,7 +138,7 @@ class OOoBuilder(Implicit):
return
li
return
li
def
getMimeType
(
self
):
def
getMimeType
(
self
):
return
self
.
extract
(
'mimetype'
)
return
bytes2str
(
self
.
extract
(
'mimetype'
)
)
def
prepareContentXml
(
self
,
ooo_xml_file_id
):
def
prepareContentXml
(
self
,
ooo_xml_file_id
):
"""
"""
...
@@ -145,7 +146,7 @@ class OOoBuilder(Implicit):
...
@@ -145,7 +146,7 @@ class OOoBuilder(Implicit):
- add tal namespace
- add tal namespace
- indent the xml
- indent the xml
"""
"""
content_xml
=
self
.
extract
(
ooo_xml_file_id
)
content_xml
=
bytes2str
(
self
.
extract
(
ooo_xml_file_id
)
)
content_doc
=
etree
.
XML
(
content_xml
)
content_doc
=
etree
.
XML
(
content_xml
)
root
=
content_doc
.
getroottree
().
getroot
()
root
=
content_doc
.
getroottree
().
getroot
()
#Declare zope namespaces
#Declare zope namespaces
...
@@ -176,7 +177,7 @@ class OOoBuilder(Implicit):
...
@@ -176,7 +177,7 @@ class OOoBuilder(Implicit):
def
updateManifest
(
self
):
def
updateManifest
(
self
):
""" Add a path to the manifest """
""" Add a path to the manifest """
MANIFEST_FILENAME
=
'META-INF/manifest.xml'
MANIFEST_FILENAME
=
'META-INF/manifest.xml'
meta_infos
=
self
.
extract
(
MANIFEST_FILENAME
)
meta_infos
=
bytes2str
(
self
.
extract
(
MANIFEST_FILENAME
)
)
# prevent some duplicates
# prevent some duplicates
for
meta_line
in
meta_infos
.
split
(
'
\
n
'
):
for
meta_line
in
meta_infos
.
split
(
'
\
n
'
):
for
new_meta_line
in
self
.
_manifest_additions_list
:
for
new_meta_line
in
self
.
_manifest_additions_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