summaryrefslogtreecommitdiff
path: root/repoze/bfg/location.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-12-09 00:34:50 +0000
committerChris McDonough <chrism@agendaless.com>2009-12-09 00:34:50 +0000
commit8b1f6e5ed3f9fc32b5eb03257d24eaf754a797a9 (patch)
treeb0525c11e88c5adf6c233c09d7e9318429d54265 /repoze/bfg/location.py
parentf46de3bb0a9d2c9823aa3221fd28d80aed65b719 (diff)
downloadpyramid-8b1f6e5ed3f9fc32b5eb03257d24eaf754a797a9.tar.gz
pyramid-8b1f6e5ed3f9fc32b5eb03257d24eaf754a797a9.tar.bz2
pyramid-8b1f6e5ed3f9fc32b5eb03257d24eaf754a797a9.zip
- General documentation freshening which takes imperative
configuration into account in more places and uses glossary references more liberally.
Diffstat (limited to 'repoze/bfg/location.py')
-rw-r--r--repoze/bfg/location.py28
1 files changed, 12 insertions, 16 deletions
diff --git a/repoze/bfg/location.py b/repoze/bfg/location.py
index 8e8eff671..fd3bd3792 100644
--- a/repoze/bfg/location.py
+++ b/repoze/bfg/location.py
@@ -12,18 +12,14 @@
#
##############################################################################
-"""Location support loosely based from ``zope.location``, but without
-``zope.security`` support or proxy support, neither of which is used
-by ``repoze.bfg``
-"""
-
def inside(model1, model2):
"""Is ``model1`` 'inside' ``model2``? Return ``True`` if so, else
``False``.
- ``model1`` is 'inside' ``model2`` if ``model2`` is a `location
- ancestor` of ``model1``. It is a location ancestor if its parent
- (or one of its parent's parents, etc.) is an ancestor.
+ ``model1`` is 'inside' ``model2`` if ``model2`` is a
+ :term:`lineage` ancestor of ``model1``. It is a lineage ancestor
+ if its parent (or one of its parent's parents, etc.) is an
+ ancestor.
"""
while model1 is not None:
if model1 is model2:
@@ -34,14 +30,14 @@ def inside(model1, model2):
def lineage(model):
"""
- Return a generator representing the model lineage. The generator
- first returns ``model`` unconditionally. Then, if ``model``
- supplies a ``__parent__`` attribute, return the object represented
- by ``model.__parent__``. If *that* object has a ``__parent__``
- attribute, return that object's parent, and so on, until the
- object being inspected either has no ``__parent__`` attribute or
- which has a ``__parent__`` attribute of ``None``. For example, if
- the object tree is::
+ Return a generator representing the :term:`lineage` of the
+ ``model``. The generator first returns ``model`` unconditionally.
+ Then, if ``model`` supplies a ``__parent__`` attribute, return the
+ object represented by ``model.__parent__``. If *that* object has
+ a ``__parent__`` attribute, return that object's parent, and so
+ on, until the object being inspected either has no ``__parent__``
+ attribute or which has a ``__parent__`` attribute of ``None``.
+ For example, if the object tree is::
thing1 = Thing()
thing2 = Thing()