summaryrefslogtreecommitdiff
path: root/paste/debug/prints.py
diff options
context:
space:
mode:
authorianb <devnull@localhost>2006-05-26 22:55:23 +0000
committerianb <devnull@localhost>2006-05-26 22:55:23 +0000
commit5f0eeac5e22368a3923969d7d1430bd7db5d674a (patch)
tree87c9aec0c119aefedcd46d57a567af80c0236885 /paste/debug/prints.py
parente68156baa22bedc843854ed13479f9bb9da89e9c (diff)
downloadpaste-5f0eeac5e22368a3923969d7d1430bd7db5d674a.tar.gz
some improvements to controlling where the output of paste.debug.prints goes
Diffstat (limited to 'paste/debug/prints.py')
-rw-r--r--paste/debug/prints.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/paste/debug/prints.py b/paste/debug/prints.py
index 795ef73..a4cc51b 100644
--- a/paste/debug/prints.py
+++ b/paste/debug/prints.py
@@ -9,7 +9,7 @@ the page. It will usually be included as a floating element in the
top right hand corner of the page. If you want to override this
you can include a tag in your template where it will be placed::
- <pre id="paste.debug.prints"></pre>
+ <pre id="paste-debug-prints"></pre>
You might want to include ``style="white-space: normal"``, as all the
whitespace will be quoted, and this allows the text to wrap if
@@ -117,20 +117,20 @@ class PrintDebugMiddleware(object):
threadedprint.deregister()
_body_re = re.compile(r'<body[^>]*>', re.I)
- _explicit_re = re.compile(r'<pre\s*[^>]*id="paste.debug.prints".*?>',
+ _explicit_re = re.compile(r'<pre\s*[^>]*id="paste-debug-prints".*?>',
re.I+re.S)
def add_log(self, html, log):
if not log:
return html
text = cgi.escape(log)
- text = text.replace('\n', '<br>\n')
+ text = text.replace('\n', '<br>')
text = text.replace(' ', '&nbsp; ')
match = self._explicit_re.search(html)
if not match:
- log = self.log_template % log
+ text = self.log_template % text
match = self._body_re.search(html)
if not match:
- return log + html
+ return text + html
else:
- return html[:match.end()] + log + html[match.end():]
+ return html[:match.end()] + text + html[match.end():]