diff options
author | Ian Bicking <ian@ianbicking.org> | 2005-08-15 16:47:38 +0000 |
---|---|---|
committer | Ian Bicking <ian@ianbicking.org> | 2005-08-15 16:47:38 +0000 |
commit | 23ba269d2c0959358f0753221b0b6ae9709a2c46 (patch) | |
tree | c8165871c7525dcdfad0b9bb3807a8f708991b89 /paste/webkit/wkservlet.py | |
parent | b7203a314772fed127fb68d4c44e9c105c8af44f (diff) | |
download | paste-git-23ba269d2c0959358f0753221b0b6ae9709a2c46.tar.gz |
Added form variables to traceback
Diffstat (limited to 'paste/webkit/wkservlet.py')
-rw-r--r-- | paste/webkit/wkservlet.py | 14 |
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() |