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
fa1d59aa
Commit
fa1d59aa
authored
Apr 01, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XMLExportImport: more support pickle protocol 3
🚧
( repair python2 )
parent
2b2c08f5
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
164 additions
and
192 deletions
+164
-192
product/ERP5Type/XMLExportImport/__init__.py
product/ERP5Type/XMLExportImport/__init__.py
+1
-8
product/ERP5Type/XMLExportImport/ppml.py
product/ERP5Type/XMLExportImport/ppml.py
+161
-182
product/ERP5Type/XMLExportImport/xyap.py
product/ERP5Type/XMLExportImport/xyap.py
+2
-2
No files found.
product/ERP5Type/XMLExportImport/__init__.py
View file @
fa1d59aa
...
...
@@ -317,7 +317,7 @@ def XMLrecord(oid, plen, p, id_mapping):
p
=
u
.
load
(
id_mapping
=
id_mapping
).
__str__
(
4
)
if
f
.
tell
()
<
plen
:
p
=
p
+
u
.
load
(
id_mapping
=
id_mapping
).
__str__
(
4
)
String
=
' <record id="%s" aka="%s">
\
n
%s </record>
\
n
'
%
(
id
,
aka
.
decode
(
),
p
)
String
=
' <record id="%s" aka="%s">
\
n
%s </record>
\
n
'
%
(
id
,
bytes2str
(
aka
),
p
)
return
String
def
exportXML
(
jar
,
oid
,
file
=
None
):
...
...
@@ -363,12 +363,6 @@ def exportXML(jar, oid, file=None):
p
=
getReorderedPickle
(
oid
)
write
(
XMLrecord
(
oid
,
len
(
p
),
p
,
id_mapping
))
write
(
'</ZopeData>
\
n
'
)
if
0
:
try
:
print
(
file
.
getvalue
())
except
AttributeError
:
pass
import
pdb
;
pdb
.
set_trace
()
return
file
class
zopedata
:
...
...
@@ -421,7 +415,6 @@ def importXML(jar, file, clue=''):
F
.
end_handlers
[
'record'
]
=
save_record
F
.
end_handlers
[
'ZopeData'
]
=
save_zopedata
F
.
start_handlers
[
'ZopeData'
]
=
start_zopedata
F
.
binary
=
1
F
.
file
=
outfile
# <patch>
# Our BTs XML files don't declare encoding but have accented chars in them
...
...
product/ERP5Type/XMLExportImport/ppml.py
View file @
fa1d59aa
This diff is collapsed.
Click to expand it.
product/ERP5Type/XMLExportImport/xyap.py
View file @
fa1d59aa
...
...
@@ -24,7 +24,7 @@ import string
import
xml.parsers.expat
class
xyap
:
class
xyap
(
object
)
:
start_handlers
=
{}
end_handlers
=
{}
...
...
@@ -57,7 +57,7 @@ class xyap:
top
=
end
[
tag
](
self
,
tag
,
top
)
append
(
top
)
class
NoBlanks
:
class
NoBlanks
(
object
)
:
def
handle_data
(
self
,
data
):
if
data
.
strip
():
...
...
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