Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Acquisition
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
Acquisition
Commits
56a8ece3
Commit
56a8ece3
authored
Mar 20, 2015
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove some leftover erroneous comments and simplify a few conditions.
parent
cae149de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
14 deletions
+5
-14
src/Acquisition/__init__.py
src/Acquisition/__init__.py
+5
-14
No files found.
src/Acquisition/__init__.py
View file @
56a8ece3
...
@@ -196,8 +196,6 @@ def _Wrapper_findattr(wrapper, name,
...
@@ -196,8 +196,6 @@ def _Wrapper_findattr(wrapper, name,
if
orig_object
is
None
:
if
orig_object
is
None
:
orig_object
=
wrapper
orig_object
=
wrapper
# Trivial port of the C function
# First, special names
# First, special names
if
name
.
startswith
(
'aq'
)
or
name
==
'__parent__'
:
if
name
.
startswith
(
'aq'
)
or
name
==
'__parent__'
:
# __parent__ is an alias of aq_parent
# __parent__ is an alias of aq_parent
...
@@ -218,7 +216,7 @@ def _Wrapper_findattr(wrapper, name,
...
@@ -218,7 +216,7 @@ def _Wrapper_findattr(wrapper, name,
# If we're doing a containment search, replace the wrapper with aq_inner
# If we're doing a containment search, replace the wrapper with aq_inner
if
containment
:
if
containment
:
while
wrapper
.
_obj
is
not
None
and
isinstance
(
wrapper
.
_obj
,
_Wrapper
):
while
isinstance
(
wrapper
.
_obj
,
_Wrapper
):
wrapper
=
wrapper
.
_obj
wrapper
=
wrapper
.
_obj
if
search_self
and
wrapper
.
_obj
is
not
None
:
if
search_self
and
wrapper
.
_obj
is
not
None
:
...
@@ -731,24 +729,17 @@ def aq_parent(obj):
...
@@ -731,24 +729,17 @@ def aq_parent(obj):
if
isinstance
(
obj
,
_Wrapper
):
if
isinstance
(
obj
,
_Wrapper
):
return
object
.
__getattribute__
(
obj
,
'_container'
)
return
object
.
__getattribute__
(
obj
,
'_container'
)
# if not a wrapper, deal with the __parent__
# if not a wrapper, deal with the __parent__
# XXX have to implement the mixed checking
return
getattr
(
obj
,
'__parent__'
,
None
)
return
getattr
(
obj
,
'__parent__'
,
None
)
def
aq_chain
(
obj
,
containment
=
False
):
def
aq_chain
(
obj
,
containment
=
False
):
# This is a straight port of the C code,
# but it doesn't work for the containment branch...
# not that I really understand what that branch is supposed to do
def
isWrapper
(
self
):
return
isinstance
(
self
,
_Wrapper
)
result
=
[]
result
=
[]
while
True
:
while
True
:
if
is
Wrapper
(
obj
):
if
is
instance
(
obj
,
_Wrapper
):
if
obj
.
_obj
is
not
None
:
if
obj
.
_obj
is
not
None
:
if
containment
:
if
containment
:
while
obj
.
_obj
is
not
None
and
isWrapper
(
obj
.
_obj
):
while
isinstance
(
obj
.
_obj
,
_Wrapper
):
obj
=
obj
.
_obj
obj
=
obj
.
_obj
result
.
append
(
obj
)
result
.
append
(
obj
)
if
obj
.
_container
is
not
None
:
if
obj
.
_container
is
not
None
:
...
@@ -796,10 +787,10 @@ def aq_inner(obj):
...
@@ -796,10 +787,10 @@ def aq_inner(obj):
if
not
isinstance
(
obj
,
_Wrapper
):
if
not
isinstance
(
obj
,
_Wrapper
):
return
obj
return
obj
result
=
obj
.
aq_self
result
=
obj
.
_obj
while
isinstance
(
result
,
_Wrapper
):
while
isinstance
(
result
,
_Wrapper
):
obj
=
result
obj
=
result
result
=
result
.
aq_self
result
=
result
.
_obj
result
=
obj
result
=
obj
return
result
return
result
...
...
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