summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2012-07-29 13:18:44 -0400
committerChris McDonough <chrism@plope.com>2012-07-29 13:18:44 -0400
commit440e2e7d94648973a3f9b5aa6136792d02ae1e9e (patch)
tree6ece94058e9f10aea2b9f73cfcb876f9f719dca5
parentd204b348535e4f28df4d59d25aa9b493306d41e5 (diff)
downloadpyramid-440e2e7d94648973a3f9b5aa6136792d02ae1e9e.tar.gz
pyramid-440e2e7d94648973a3f9b5aa6136792d02ae1e9e.tar.bz2
pyramid-440e2e7d94648973a3f9b5aa6136792d02ae1e9e.zip
give traverse_predicate a __text__ and add a developer note about __text__
-rw-r--r--pyramid/config/util.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/pyramid/config/util.py b/pyramid/config/util.py
index b8d0f2319..4e4c93be3 100644
--- a/pyramid/config/util.py
+++ b/pyramid/config/util.py
@@ -113,6 +113,12 @@ def make_predicates(xhr=None, request_method=None, path_info=None,
# any predicates get an order of MAX_ORDER, meaning that they will
# be tried very last.
+ # NB: each predicate callable constructed by this function (or examined
+ # by this function, in the case of custom predicates) must leave this
+ # function with a ``__text__`` attribute. The subsystem which reports
+ # errors when no predicates match depends upon the existence of this
+ # attribute on each predicate callable.
+
predicates = []
weights = []
h = md5()
@@ -273,6 +279,7 @@ def make_predicates(xhr=None, request_method=None, path_info=None,
tvalue = tgenerate(m) # tvalue will be urlquoted string
m['traverse'] = traversal_path(tvalue) # will be seq of unicode
return True
+ traverse_predicate.__text__ = 'traverse matchdict pseudo-predicate'
# This isn't actually a predicate, it's just a infodict
# modifier that injects ``traverse`` into the matchdict. As a
# result, the ``traverse_predicate`` function above always