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
b0bb5fc2
Commit
b0bb5fc2
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
519b0c14
Changes
3
Expand all
Show 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 @
b0bb5fc2
...
@@ -317,7 +317,7 @@ def XMLrecord(oid, plen, p, id_mapping):
...
@@ -317,7 +317,7 @@ def XMLrecord(oid, plen, p, id_mapping):
p
=
u
.
load
(
id_mapping
=
id_mapping
).
__str__
(
4
)
p
=
u
.
load
(
id_mapping
=
id_mapping
).
__str__
(
4
)
if
f
.
tell
()
<
plen
:
if
f
.
tell
()
<
plen
:
p
=
p
+
u
.
load
(
id_mapping
=
id_mapping
).
__str__
(
4
)
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
return
String
def
exportXML
(
jar
,
oid
,
file
=
None
):
def
exportXML
(
jar
,
oid
,
file
=
None
):
...
@@ -363,12 +363,6 @@ def exportXML(jar, oid, file=None):
...
@@ -363,12 +363,6 @@ def exportXML(jar, oid, file=None):
p
=
getReorderedPickle
(
oid
)
p
=
getReorderedPickle
(
oid
)
write
(
XMLrecord
(
oid
,
len
(
p
),
p
,
id_mapping
))
write
(
XMLrecord
(
oid
,
len
(
p
),
p
,
id_mapping
))
write
(
'</ZopeData>
\
n
'
)
write
(
'</ZopeData>
\
n
'
)
if
0
:
try
:
print
(
file
.
getvalue
())
except
AttributeError
:
pass
import
pdb
;
pdb
.
set_trace
()
return
file
return
file
class
zopedata
:
class
zopedata
:
...
@@ -421,7 +415,6 @@ def importXML(jar, file, clue=''):
...
@@ -421,7 +415,6 @@ def importXML(jar, file, clue=''):
F
.
end_handlers
[
'record'
]
=
save_record
F
.
end_handlers
[
'record'
]
=
save_record
F
.
end_handlers
[
'ZopeData'
]
=
save_zopedata
F
.
end_handlers
[
'ZopeData'
]
=
save_zopedata
F
.
start_handlers
[
'ZopeData'
]
=
start_zopedata
F
.
start_handlers
[
'ZopeData'
]
=
start_zopedata
F
.
binary
=
1
F
.
file
=
outfile
F
.
file
=
outfile
# <patch>
# <patch>
# Our BTs XML files don't declare encoding but have accented chars in them
# Our BTs XML files don't declare encoding but have accented chars in them
...
...
product/ERP5Type/XMLExportImport/ppml.py
View file @
b0bb5fc2
This diff is collapsed.
Click to expand it.
product/ERP5Type/XMLExportImport/xyap.py
View file @
b0bb5fc2
...
@@ -24,7 +24,7 @@ import string
...
@@ -24,7 +24,7 @@ import string
import
xml.parsers.expat
import
xml.parsers.expat
class
xyap
:
class
xyap
(
object
)
:
start_handlers
=
{}
start_handlers
=
{}
end_handlers
=
{}
end_handlers
=
{}
...
@@ -57,7 +57,7 @@ class xyap:
...
@@ -57,7 +57,7 @@ class xyap:
top
=
end
[
tag
](
self
,
tag
,
top
)
top
=
end
[
tag
](
self
,
tag
,
top
)
append
(
top
)
append
(
top
)
class
NoBlanks
:
class
NoBlanks
(
object
)
:
def
handle_data
(
self
,
data
):
def
handle_data
(
self
,
data
):
if
data
.
strip
():
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