Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
fd9b9677
Commit
fd9b9677
authored
Jun 01, 1999
by
joey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed xmlPickler to represent id's as integers.
parent
c01b4353
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
12 deletions
+34
-12
utilities/ppml.py
utilities/ppml.py
+34
-12
No files found.
utilities/ppml.py
View file @
fd9b9677
...
...
@@ -507,8 +507,8 @@ def start_pickle(self, tag, attr):
def
end_string
(
self
,
tag
,
data
):
v
=
data
[
2
]
a
=
data
[
1
]
if
a
is
not
None
:
v
=
unconvert
(
a
,
v
)
if
a
[
'encoding'
]
is
not
''
:
v
=
unconvert
(
a
[
'encoding'
]
,
v
)
if
a
.
has_key
(
'id'
):
self
.
_pickleids
[
a
[
'id'
]]
=
v
return
v
...
...
@@ -581,12 +581,15 @@ def save_float(self, tag, data):
return
v
def
save_string
(
self
,
tag
,
data
):
v
=
data
[
2
]
#data[3] with encoding
v
=
data
[
2
]
a
=
data
[
1
]
encoding
=
None
# data[2] with encoding
if
encoding
is
not
None
:
encoding
=
a
[
'encoding'
]
if
encoding
is
not
''
:
v
=
base
.
unconvert
(
encoding
,
v
)
v
=
"S'"
+
v
+
"'
\
012
"
+
"p"
+
a
[
"id"
]
+
"
\
012
"
id
=
a
[
'id'
]
prefix
=
string
.
rfind
(
id
,
'.'
)
if
prefix
>=
0
:
id
=
id
[
prefix
:]
v
=
"S'"
+
v
+
"'
\
012
"
+
"p"
+
id
+
"
\
012
"
return
v
def
save_tuple
(
self
,
tag
,
data
):
...
...
@@ -595,13 +598,19 @@ def save_tuple(self, tag, data):
v
=
''
for
x
in
T
:
v
=
v
+
x
if
a
.
has_key
(
'id'
):
v
=
'('
+
v
+
'tp'
+
a
[
'id'
]
+
'
\
012
'
id
=
a
[
'id'
]
prefix
=
string
.
rfind
(
id
,
'.'
)
if
prefix
>=
0
:
id
=
id
[
prefix
:]
if
a
.
has_key
(
'id'
):
v
=
'('
+
v
+
'tp'
+
id
+
'
\
012
'
return
v
def
save_list
(
self
,
tag
,
data
):
L
=
data
[
2
:]
a
=
data
[
1
]
v
=
'(lp'
+
a
[
'id'
]
+
'
\
012
'
id
=
a
[
'id'
]
prefix
=
string
.
rfind
(
id
,
'.'
)
if
prefix
>=
0
:
id
=
id
[
prefix
:]
v
=
'(lp'
+
id
+
'
\
012
'
x
=
0
while
x
<
len
(
L
):
v
=
v
+
L
[
x
]
+
'a'
...
...
@@ -611,7 +620,10 @@ def save_list(self, tag, data):
def
save_dict
(
self
,
tag
,
data
):
D
=
data
[
2
:]
a
=
data
[
1
]
v
=
'(dp'
+
a
[
'id'
]
+
'
\
012
'
id
=
a
[
'id'
]
prefix
=
string
.
rfind
(
id
,
'.'
)
if
prefix
>=
0
:
id
=
id
[
prefix
:]
v
=
'(dp'
+
id
+
'
\
012
'
x
=
0
while
x
<
len
(
D
):
v
=
v
+
D
[
x
]
+
's'
...
...
@@ -630,7 +642,11 @@ def save_pickle(self, tag, data):
return
v
def
save_reference
(
self
,
tag
,
data
):
v
=
'g'
+
data
[
1
][
'id'
]
+
'
\
012
'
a
=
data
[
1
]
id
=
a
[
'id'
]
prefix
=
string
.
rfind
(
id
,
'.'
)
if
prefix
>=
0
:
id
=
id
[
prefix
:]
v
=
'g'
+
id
+
'
\
012
'
return
v
def
save_object
(
self
,
tag
,
data
):
...
...
@@ -638,14 +654,20 @@ def save_object(self, tag, data):
v
=
'(c'
for
x
in
data
[
2
:]:
v
=
v
+
x
v
=
v
+
'p'
+
a
[
'id'
]
+
'
\
012
'
+
'b'
id
=
a
[
'id'
]
prefix
=
string
.
rfind
(
id
,
'.'
)
if
prefix
>=
0
:
id
=
id
[
prefix
:]
v
=
v
+
'p'
+
id
+
'
\
012
'
+
'b'
if
a
.
has_key
(
'id'
):
self
.
_pickleids
[
a
[
'id'
]]
=
v
return
v
def
save_global
(
self
,
tag
,
data
):
a
=
data
[
1
]
if
a
.
has_key
(
'id'
):
v
=
a
[
'module'
]
+
'
\
012
'
+
a
[
'name'
]
+
'
\
012
op'
+
a
[
'id'
]
+
'
\
012
'
id
=
a
[
'id'
]
prefix
=
string
.
rfind
(
id
,
'.'
)
if
prefix
>=
0
:
id
=
id
[
prefix
:]
v
=
a
[
'module'
]
+
'
\
012
'
+
a
[
'name'
]
+
'
\
012
op'
+
id
+
'
\
012
'
self
.
_pickleids
[
a
[
'id'
]]
=
v
else
:
v
=
a
[
'module'
]
+
'
\
012
'
+
a
[
'name'
]
+
'
\
012
o'
return
v
...
...
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