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
f37ffe13
Commit
f37ffe13
authored
Mar 20, 2023
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OOoUtils: deprecated openFromString in favor of openFromBytes WIP
🚧
parent
e4df9d77
Pipeline
#27225
canceled with stage
in 0 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getCategoriesSpreadSheetMapping.py
...l_skins/erp5_core/Base_getCategoriesSpreadSheetMapping.py
+1
-1
product/ERP5OOo/OOoUtils.py
product/ERP5OOo/OOoUtils.py
+4
-2
No files found.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getCategoriesSpreadSheetMapping.py
View file @
f37ffe13
...
@@ -91,7 +91,7 @@ if not (content_type.startswith('application/vnd.sun.xml')
...
@@ -91,7 +91,7 @@ if not (content_type.startswith('application/vnd.sun.xml')
content_type
=
content_type
)
content_type
=
content_type
)
tmp_ooo
.
convertToBaseFormat
()
tmp_ooo
.
convertToBaseFormat
()
_
,
import_file_content
=
tmp_ooo
.
convert
(
'ods'
)
_
,
import_file_content
=
tmp_ooo
.
convert
(
'ods'
)
parser
.
openFrom
String
(
str
(
import_file_content
))
parser
.
openFrom
Bytes
(
bytes
(
import_file_content
))
else
:
else
:
parser
.
openFile
(
import_file
)
parser
.
openFile
(
import_file
)
...
...
product/ERP5OOo/OOoUtils.py
View file @
f37ffe13
...
@@ -50,6 +50,7 @@ from lxml.etree import Element, XMLSyntaxError
...
@@ -50,6 +50,7 @@ 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
from
Products.ERP5Type.Utils
import
bytes2str
from
Products.ERP5Type.Utils
import
deprecated
class
CorruptedOOoFile
(
Exception
):
pass
class
CorruptedOOoFile
(
Exception
):
pass
...
@@ -234,8 +235,9 @@ class OOoParser(Implicit):
...
@@ -234,8 +235,9 @@ class OOoParser(Implicit):
self
.
pictures
=
{}
self
.
pictures
=
{}
self
.
filename
=
None
self
.
filename
=
None
def
openFromString
(
self
,
text_content
):
def
openFromBytes
(
self
,
bytes_content
):
return
self
.
openFile
(
BytesIO
(
text_content
))
return
self
.
openFile
(
BytesIO
(
bytes_content
))
openFromString
=
deprecated
(
"openFromString is deprecated, use openFromBytes instead"
)(
openFromBytes
)
def
openFile
(
self
,
file_descriptor
):
def
openFile
(
self
,
file_descriptor
):
"""
"""
...
...
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