summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorianb <devnull@localhost>2006-10-20 19:05:40 +0000
committerianb <devnull@localhost>2006-10-20 19:05:40 +0000
commite4815ce24daa232d588d588490b214b079890451 (patch)
tree0a9c47646725922c9b48c9db15fd1ea9bc7b90a2
parent342e1dba47ffba616b0b578a70412a867c6d89a7 (diff)
downloadpaste-e4815ce24daa232d588d588490b214b079890451.tar.gz
Moved evalexception entry point
-rw-r--r--paste/evalexception/middleware.py18
-rw-r--r--setup.py2
2 files changed, 19 insertions, 1 deletions
diff --git a/paste/evalexception/middleware.py b/paste/evalexception/middleware.py
index 99228b1..04327d8 100644
--- a/paste/evalexception/middleware.py
+++ b/paste/evalexception/middleware.py
@@ -572,3 +572,21 @@ error_template = '''
</body>
</html>
'''
+
+def make_eval_exception(app, global_conf, xmlhttp_key=None):
+ """
+ Wraps the application in an interactive debugger.
+
+ This debugger is a major security hole, and should only be
+ used during development.
+
+ xmlhttp_key is a string that, if present in QUERY_STRING,
+ indicates that the request is an XMLHttp request, and the
+ Javascript/interactive debugger should not be returned. (If you
+ try to put the debugger somewhere with innerHTML, you will often
+ crash the browser)
+ """
+ if xmlhttp_key is None:
+ xmlhttp_key = global_conf.get('xmlhttp_key', '_')
+ return EvalException(app, xmlhttp_key=xmlhttp_key)
+
diff --git a/setup.py b/setup.py
index b630659..d91c119 100644
--- a/setup.py
+++ b/setup.py
@@ -165,7 +165,7 @@ For the latest changes see the `news file
# This isn't good enough to deserve the name egg:Paste#session:
paste_session = paste.session:make_session_middleware
wdg_validate = paste.debug.wdg_validate:make_wdg_validate_middleware [subprocess]
- evalerror = paste.evalexception:EvalException
+ evalerror = paste.evalexception.middleware:make_eval_exception
auth_tkt = paste.auth.auth_tkt:make_auth_tkt_middleware
auth_basic = paste.auth.basic:make_basic
auth_digest = paste.auth.digest:make_digest