From 73e31c15fd405a8848592800a66ffad547d49e19 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 25 Jul 2011 01:53:44 -0400 Subject: garden; whitespace, comment cleanups --- TODO.txt | 18 +++++++++++++++++- pyramid/router.py | 10 +++------- pyramid/urldispatch.py | 1 - 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/TODO.txt b/TODO.txt index 49f137fa2..8cfac8ceb 100644 --- a/TODO.txt +++ b/TODO.txt @@ -5,7 +5,11 @@ Should-Have ----------- - Make "localizer" a property of request (instead of requiring - "get_localizer(request)"? + "get_localizer(request)" + +- Make ``current_route_url`` a method of request. + +- Create a ``current_route_path`` function and make it a method of request. - Add narrative docs for wsgiapp and wsgiapp2. @@ -18,6 +22,18 @@ Should-Have - Try to figure out a way to keep "settings" as the original dictionary passed to the Configurator instead of copying it. +- Merge aodag's config.include(route_prefix=...) fork. + +- Michael's route group work. + +- Kill off ``bfg.routes`` envvars in router. + +- Provide a ``has_view`` function. + +- Alias the stupid long default session factory name. + +- Fix indirect circular import between router and config. + Nice-to-Have ------------ diff --git a/pyramid/router.py b/pyramid/router.py index e8c19fca0..efbf0b326 100644 --- a/pyramid/router.py +++ b/pyramid/router.py @@ -65,6 +65,7 @@ class Router(object): has_listeners = registry.has_listeners notify = registry.notify logger = self.logger + try: # matches except Exception (exception view execution) has_listeners and notify(NewRequest(request)) # find the root object @@ -205,22 +206,17 @@ class Router(object): threadlocals = {'registry':registry, 'request':request} manager.push(threadlocals) - try: # matches finally: manager.pop() - - try: # matches finally: ... call request finished callbacks ... - - # create the request + try: + try: request = self.request_factory(environ) threadlocals['request'] = request request.registry = registry response = self.handle_request(request) - finally: if request is not None and request.finished_callbacks: request._process_finished_callbacks() return response(request.environ, start_response) - finally: manager.pop() diff --git a/pyramid/urldispatch.py b/pyramid/urldispatch.py index 2cbbb8709..3530126eb 100644 --- a/pyramid/urldispatch.py +++ b/pyramid/urldispatch.py @@ -10,7 +10,6 @@ from pyramid.exceptions import URLDecodeError from pyramid.traversal import traversal_path from pyramid.traversal import quote_path_segment - _marker = object() class Route(object): -- cgit v1.2.3