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
55f4c18a
Commit
55f4c18a
authored
Jun 25, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various (not-checked-in) changes by Chris and some by Guido.
parent
a6fe813d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
13 deletions
+22
-13
lib/Components/cPickle/pickle.py
lib/Components/cPickle/pickle.py
+22
-13
No files found.
lib/Components/cPickle/pickle.py
View file @
55f4c18a
# $Id: pickle.py,v 1.1
2 1997/03/04 23:11:38 chris
Exp $
# $Id: pickle.py,v 1.1
3 1997/06/25 19:30:25 jim
Exp $
#
# Copyright
#
...
...
@@ -199,6 +199,7 @@ UnpicklingError = "pickle.UnpicklingError"
MARK
=
'('
STOP
=
'.'
POP
=
'0'
POP_MARK
=
'1'
DUP
=
'2'
FLOAT
=
'F'
INT
=
'I'
...
...
@@ -434,7 +435,11 @@ class Pickler:
save
(
element
)
if
(
len
(
object
)
and
memo
.
has_key
(
d
)):
write
(
POP
*
len
(
object
)
+
self
.
get
(
memo
[
d
][
0
]))
if
(
self
.
bin
):
write
(
POP_MARK
+
self
.
get
(
memo
[
d
][
0
]))
return
write
(
POP
*
(
len
(
object
)
+
1
)
+
self
.
get
(
mem
[
d
][
0
]))
return
memo_len
=
len
(
memo
)
...
...
@@ -457,6 +462,10 @@ class Pickler:
else
:
write
(
MARK
+
LIST
)
memo_len
=
len
(
memo
)
write
(
self
.
put
(
memo_len
))
memo
[
d
]
=
(
memo_len
,
object
)
using_appends
=
(
self
.
bin
and
(
len
(
object
)
>
1
))
if
(
using_appends
):
...
...
@@ -470,10 +479,6 @@ class Pickler:
if
(
using_appends
):
write
(
APPENDS
)
memo_len
=
len
(
memo
)
write
(
self
.
put
(
memo_len
))
memo
[
d
]
=
(
memo_len
,
object
)
dispatch
[
ListType
]
=
save_list
def
save_dict
(
self
,
object
):
...
...
@@ -488,6 +493,10 @@ class Pickler:
else
:
write
(
MARK
+
DICT
)
memo_len
=
len
(
memo
)
self
.
write
(
self
.
put
(
memo_len
))
memo
[
d
]
=
(
memo_len
,
object
)
using_setitems
=
(
self
.
bin
and
(
len
(
object
)
>
1
))
if
(
using_setitems
):
...
...
@@ -504,9 +513,6 @@ class Pickler:
if
(
using_setitems
):
write
(
SETITEMS
)
memo_len
=
len
(
memo
)
self
.
write
(
self
.
put
(
memo_len
))
memo
[
d
]
=
(
memo_len
,
object
)
dispatch
[
DictionaryType
]
=
save_dict
def
save_inst
(
self
,
object
):
...
...
@@ -585,7 +591,8 @@ def whichmodule(cls, clsname):
import
sys
for
name
,
module
in
sys
.
modules
.
items
():
if
hasattr
(
module
,
clsname
)
and
\
if
name
!=
'__main__'
and
\
hasattr
(
module
,
clsname
)
and
\
getattr
(
module
,
clsname
)
is
cls
:
break
else
:
...
...
@@ -724,9 +731,6 @@ class Unpickler:
module
=
self
.
readline
()[:
-
1
]
name
=
self
.
readline
()[:
-
1
]
klass
=
self
.
find_class
(
module
,
name
)
if
(
type
(
klass
)
is
not
ClassType
):
raise
SystemError
,
"Imported object %s from module %s is "
\
"not a class"
%
(
name
,
module
)
value
=
apply
(
klass
,
args
)
self
.
append
(
value
)
...
...
@@ -788,6 +792,11 @@ class Unpickler:
del
self
.
stack
[
-
1
]
dispatch
[
POP
]
=
load_pop
def
load_pop_mark
(
self
):
k
=
self
.
marker
()
del
self
.
stack
[
k
:]
dispatch
[
POP_MARK
]
=
load_pop_mark
def
load_dup
(
self
):
self
.
append
(
stack
[
-
1
])
dispatch
[
DUP
]
=
load_dup
...
...
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