Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zope-container
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
Boxiang Sun
zope-container
Commits
672237d8
Commit
672237d8
authored
Feb 26, 2013
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PEP-8ify additions as recommended by the pep8 tool.
parent
ad3e7a0b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
src/zope/container/folder.py
src/zope/container/folder.py
+6
-7
src/zope/container/tests/test_folder.py
src/zope/container/tests/test_folder.py
+3
-3
No files found.
src/zope/container/folder.py
View file @
672237d8
...
...
@@ -31,14 +31,13 @@ class Folder(btree.BTreeContainer):
def
data
(
self
,
value
):
self
.
_SampleContainer__data
=
value
def
__getstate__
(
self
):
state
=
super
(
Folder
,
self
).
__getstate__
()
data
=
state
.
pop
(
'_SampleContainer__data'
)
def
__getstate__
(
self
):
state
=
super
(
Folder
,
self
).
__getstate__
()
data
=
state
.
pop
(
'_SampleContainer__data'
)
state
[
'data'
]
=
data
return
state
def
__setstate__
(
self
,
state
):
def
__setstate__
(
self
,
state
):
if
'data'
in
state
and
'_SampleContainer__data'
not
in
state
:
state
[
'_SampleContainer__data'
]
=
state
.
pop
(
'data'
)
super
(
Folder
,
self
).
__setstate__
(
state
)
state
[
'_SampleContainer__data'
]
=
state
.
pop
(
'data'
)
super
(
Folder
,
self
).
__setstate__
(
state
)
src/zope/container/tests/test_folder.py
View file @
672237d8
...
...
@@ -19,10 +19,10 @@ class Test(TestSampleContainer, TestCase):
def
testPickleCompatibility
(
self
):
folder
=
self
.
makeTestObject
()
folder
[
'a'
]
=
1
self
.
assertEqual
(
folder
.
__getstate__
()[
'data'
],
folder
.
_SampleContainer__data
)
self
.
assertEqual
(
folder
.
__getstate__
()[
'data'
],
folder
.
_SampleContainer__data
)
folder_clone
=
pickle
.
loads
(
pickle
.
dumps
(
folder
)
)
self
.
assertEqual
(
folder_clone
[
'a'
],
folder
[
'a'
]
)
folder_clone
=
pickle
.
loads
(
pickle
.
dumps
(
folder
)
)
self
.
assertEqual
(
folder_clone
[
'a'
],
folder
[
'a'
]
)
def
test_suite
():
...
...
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