summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-05-10 22:00:56 +0000
committerChris McDonough <chrism@agendaless.com>2009-05-10 22:00:56 +0000
commit277df8ebad5b9c6a3f45618354d7c3c96f55e247 (patch)
tree602b11af4cfa756708dd604d16ee1cf266bd51aa
parent9688acdb8178d663ed13892f3b0032411415d19c (diff)
downloadpyramid-277df8ebad5b9c6a3f45618354d7c3c96f55e247.tar.gz
pyramid-277df8ebad5b9c6a3f45618354d7c3c96f55e247.tar.bz2
pyramid-277df8ebad5b9c6a3f45618354d7c3c96f55e247.zip
Minor speed and docs tweaks.
-rw-r--r--CHANGES.txt2
-rw-r--r--repoze/bfg/urldispatch.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 759d84f47..0986820e0 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -5,7 +5,7 @@ Features
--------
- Added documentation to the URL Dispatch chapter about how to catch
- the root URL.
+ the root URL using a ZCML ``route`` directive.
Bug Fixes
---------
diff --git a/repoze/bfg/urldispatch.py b/repoze/bfg/urldispatch.py
index d3baf6d9f..ead8876de 100644
--- a/repoze/bfg/urldispatch.py
+++ b/repoze/bfg/urldispatch.py
@@ -115,6 +115,9 @@ class RoutesContextNotFound(object):
def __init__(self, msg):
self.msg = msg
+_notfound = RoutesContextNotFound(
+ 'Routes context cannot be found and no fallback "get_root"')
+
class RoutesRootFactory(Mapper):
""" The ``RoutesRootFactory`` is a wrapper for the ``get_root``
callable passed in to the repoze.bfg ``Router`` at initialization
@@ -193,11 +196,8 @@ class RoutesRootFactory(Mapper):
return context
if self.get_root is None:
- # no fallback get_root
- return RoutesContextNotFound(
- 'Routes context cannot be found and no fallback "get_root"')
+ return _notfound
- # fall back to original get_root
return self.get_root(environ)
class RoutesModelTraverser(object):