From f390c28caeb9e245cd4fc4db0466534f42f18717 Mon Sep 17 00:00:00 2001 From: bbangert Date: Tue, 13 Dec 2005 23:24:11 +0000 Subject: Using new paste.request lib --- paste/evalexception/middleware.py | 7 ++++--- paste/exceptions/errormiddleware.py | 3 ++- paste/urlparser.py | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/paste/evalexception/middleware.py b/paste/evalexception/middleware.py index c6c843f..aeaa7f0 100644 --- a/paste/evalexception/middleware.py +++ b/paste/evalexception/middleware.py @@ -28,6 +28,7 @@ from paste.exceptions import errormiddleware, formatter, collector from paste import wsgilib from paste import urlparser from paste import httpexceptions +from paste import request import evalcontext limit = 200 @@ -160,8 +161,8 @@ class EvalException(object): return self.respond(environ, start_response) def debug(self, environ, start_response): - assert wsgilib.path_info_pop(environ) == '_debug' - next_part = wsgilib.path_info_pop(environ) + assert request.path_info_pop(environ) == '_debug' + next_part = request.path_info_pop(environ) method = getattr(self, next_part, None) if not method: exc = httpexceptions.HTTPNotFound( @@ -401,7 +402,7 @@ def format_eval_html(exc_data, base_path, counter): """ % (short_er, long_er) def make_repost_button(environ): - url = wsgilib.construct_url(environ) + url = request.construct_url(environ) if environ['REQUEST_METHOD'] == 'GET': return ('
' % url) diff --git a/paste/exceptions/errormiddleware.py b/paste/exceptions/errormiddleware.py index 275bfa4..3125f1d 100644 --- a/paste/exceptions/errormiddleware.py +++ b/paste/exceptions/errormiddleware.py @@ -13,6 +13,7 @@ except ImportError: from StringIO import StringIO from paste.exceptions import formatter, collector, reporter from paste import wsgilib +from paste import request from paste.deploy import converters __all__ = ['ErrorMiddleware', 'handle_exception'] @@ -208,7 +209,7 @@ class Supplement(object): def __init__(self, middleware, environ): self.middleware = middleware self.environ = environ - self.source_url = wsgilib.construct_url(environ) + self.source_url = request.construct_url(environ) def extraData(self): data = {} diff --git a/paste/urlparser.py b/paste/urlparser.py index 47e89aa..3c380b6 100644 --- a/paste/urlparser.py +++ b/paste/urlparser.py @@ -7,6 +7,7 @@ import imp import pkg_resources import mimetypes import wsgilib +import request from paste.util import import_string from paste.deploy import converters import httpexceptions @@ -420,7 +421,7 @@ class StaticURLParser(object): # @@: This should obviously be configurable filename = 'index.html' else: - filename = wsgilib.path_info_pop(environ) + filename = request.path_info_pop(environ) full = os.path.join(self.directory, filename) if not os.path.exists(full): return self.not_found(environ, start_response) @@ -449,7 +450,7 @@ class StaticURLParser(object): def not_found(self, environ, start_response, debug_message=None): exc = httpexceptions.HTTPNotFound( 'The resource at %s could not be found' - % wsgilib.construct_url(environ), + % request.construct_url(environ), comment='SCRIPT_NAME=%r; PATH_INFO=%r; looking in %r; debug: %s' % (environ.get('SCRIPT_NAME'), environ.get('PATH_INFO'), self.directory, debug_message or '(none)')) -- cgit v1.2.1