summaryrefslogtreecommitdiff
path: root/paste/webkit/wkservlet.py
diff options
context:
space:
mode:
authorIan Bicking <ian@ianbicking.org>2005-08-15 16:47:38 +0000
committerIan Bicking <ian@ianbicking.org>2005-08-15 16:47:38 +0000
commit23ba269d2c0959358f0753221b0b6ae9709a2c46 (patch)
treec8165871c7525dcdfad0b9bb3807a8f708991b89 /paste/webkit/wkservlet.py
parentb7203a314772fed127fb68d4c44e9c105c8af44f (diff)
downloadpaste-git-23ba269d2c0959358f0753221b0b6ae9709a2c46.tar.gz
Added form variables to traceback
Diffstat (limited to 'paste/webkit/wkservlet.py')
-rw-r--r--paste/webkit/wkservlet.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/paste/webkit/wkservlet.py b/paste/webkit/wkservlet.py
index 0ffb081..ba72fbd 100644
--- a/paste/webkit/wkservlet.py
+++ b/paste/webkit/wkservlet.py
@@ -20,8 +20,9 @@ class make_application(object):
class ServletSupplement(object):
- def __init__(self, servlet):
+ def __init__(self, servlet, trans):
self.servlet = servlet
+ self.trans = trans
def extraData(self):
result = {}
@@ -31,6 +32,15 @@ class ServletSupplement(object):
if name in hide:
continue
vars[name] = value
+ result[('extra', 'Form variables')] = form = {}
+ fields = self.trans.request().fields()
+ for name, value in fields.items():
+ value = str(value)
+ if len(value) > 200:
+ value = value[:200] + '...'
+ form[name] = value
+ if not form:
+ form['none?'] = 'No fields submitted'
return result
class Servlet(object):
@@ -48,8 +58,8 @@ class Servlet(object):
The core WSGI method, and the core of the servlet execution.
"""
__traceback_hide__ = 'before_and_this'
- __traceback_supplement__ = ServletSupplement, self
trans = Transaction(environ, start_response)
+ __traceback_supplement__ = ServletSupplement, self, trans
trans.setServlet(self)
try:
trans.runTransaction()