summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-05-10 16:19:52 +0000
committerChris McDonough <chrism@agendaless.com>2009-05-10 16:19:52 +0000
commit6f318ae12bff899a8d29d725384a94c389039eb2 (patch)
tree9e727a298d0e89a3b11f084df1b384de2d5b041c
parent5cf1779a4df258740ec452c55b9f398a261aeb7b (diff)
downloadpyramid-6f318ae12bff899a8d29d725384a94c389039eb2.tar.gz
pyramid-6f318ae12bff899a8d29d725384a94c389039eb2.tar.bz2
pyramid-6f318ae12bff899a8d29d725384a94c389039eb2.zip
- In version 0.6.3, passing a ``get_root`` callback (a "root factory")
to ``repoze.bfg.router.make_app`` became optional if any ``route`` declaration was made in ZCML. The intent was to make it possible to disuse traversal entirely, instead relying entirely on URL dispatch (Routes) to resolve all contexts. However a compound set of bugs prevented usage of a Routes-based root view (a view which responds to "/"). One bug existed in `repoze.bfg.urldispatch``, another existed in Routes itself. To resolve this issue, the urldispatch module was fixed, and a fork of the Routes trunk was put into the "dev" index named ``Routes-1.11dev-chrism-home``. The source for the fork exists at `http://bitbucket.org/chrism/routes-home/ <http://bitbucket.org/chrism/routes-home/>`_; its contents have been reported to the upstream Routes developers and will hopefully be a part of the final Routes 1.11 release.
-rw-r--r--CHANGES.txt20
-rw-r--r--repoze/bfg/urldispatch.py4
2 files changed, 21 insertions, 3 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 9a9db1c40..4f73d2895 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,7 +1,25 @@
0.8dev (unreleased)
-------------------
-...
+Bug Fixes
+---------
+
+- In version 0.6.3, passing a ``get_root`` callback (a "root factory")
+ to ``repoze.bfg.router.make_app`` became optional if any ``route``
+ declaration was made in ZCML. The intent was to make it possible to
+ disuse traversal entirely, instead relying entirely on URL dispatch
+ (Routes) to resolve all contexts. However a compound set of bugs
+ prevented usage of a Routes-based root view (a view which responds
+ to "/"). One bug existed in `repoze.bfg.urldispatch``, another
+ existed in Routes itself.
+
+ To resolve this issue, the urldispatch module was fixed, and a fork
+ of the Routes trunk was put into the "dev" index named
+ ``Routes-1.11dev-chrism-home``. The source for the fork exists at
+ `http://bitbucket.org/chrism/routes-home/
+ <http://bitbucket.org/chrism/routes-home/>`_; its contents have been
+ reported to the upstream Routes developers and will hopefully be a
+ part of the final Routes 1.11 release.
0.8a5 (2009-05-08)
------------------
diff --git a/repoze/bfg/urldispatch.py b/repoze/bfg/urldispatch.py
index 526db3a9a..d3baf6d9f 100644
--- a/repoze/bfg/urldispatch.py
+++ b/repoze/bfg/urldispatch.py
@@ -64,7 +64,7 @@ class RoutesMapper(object):
path = environ.get('PATH_INFO', '/')
self.mapper.environ = environ
args = self.mapper.match(path)
- if args:
+ if isinstance(args, dict): # might be an empty dict
context_factory = args.get('context_factory', _marker)
if context_factory is _marker:
context_factory = DefaultRoutesContext
@@ -165,7 +165,7 @@ class RoutesRootFactory(Mapper):
args, route = match
else:
args = None
- if args:
+ if isinstance(args, dict): # might be an empty dict
args = args.copy()
routepath = route.routepath
factory = route._factory