From 1646770c4eee27f37e53dcb50f8a271d5c278abf Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 29 Oct 2009 23:07:48 +0000 Subject: - The ``repoze.bfg.request.Request`` class, which is a subclass of ``webob.Request`` now defines its own ``__setattr__``, ``__getattr__`` and ``__delattr__`` methods, which override the default WebOb behavior. The default WebOb behavior stores attributes of the request in ``self.environ['webob.adhoc_attrs']``, and retrieves them from that dictionary during a ``__getattr__``. This behavior was undesirable for speed and "expectation" reasons. Now attributes of the ``request`` are stored in ``request.__dict__`` (as you otherwise might expect from an object that did not override these methods). - The router no longer calls ``repoze.bfg.traversal._traverse`` and does its work "inline" (speed). --- repoze/bfg/traversal.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'repoze/bfg/traversal.py') diff --git a/repoze/bfg/traversal.py b/repoze/bfg/traversal.py index 48d7ef1c1..43adcdebb 100644 --- a/repoze/bfg/traversal.py +++ b/repoze/bfg/traversal.py @@ -268,15 +268,12 @@ def traverse(model, path): if path and path[0] == '/': model = find_root(model) - return _traverse(model, {'PATH_INFO':path}) - -def _traverse(model, environ): + environ = {'PATH_INFO':path} traverser = queryAdapter(model, ITraverser) if traverser is None: traverser = ModelGraphTraverser(model) - result = traverser(environ) - return result + return traverser(environ) def model_path_tuple(model, *elements): """ -- cgit v1.2.3