From cc3e81c627ccb8ecbdb8ea0a12dadcb1b24d1027 Mon Sep 17 00:00:00 2001 From: Ian Bicking Date: Sun, 6 Nov 2005 10:38:00 +0000 Subject: Further refactoring and expansion of the eval exception middleware; functions now, but not that fancy yet --- paste/exceptions/formatter.py | 60 +++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 22 deletions(-) (limited to 'paste/exceptions') diff --git a/paste/exceptions/formatter.py b/paste/exceptions/formatter.py index eb71ce4..d50de94 100644 --- a/paste/exceptions/formatter.py +++ b/paste/exceptions/formatter.py @@ -313,30 +313,10 @@ class HTMLFormatter(TextFormatter): % (odd and 'odd' or 'even', self.quote(name))) table.append( '%s' - % self.make_wrappable(self.quote(value))) + % make_wrappable(self.quote(value))) table.append('') return '\n'.join(table) - def make_wrappable(self, html, wrap_limit=60, - split_on=';?&@!$#-/\\"\''): - # Currently using , maybe should use ​ - # http://www.cs.tut.fi/~jkorpela/html/nobr.html - words = html.split() - new_words = [] - for word in words: - if len(word) > wrap_limit: - for char in split_on: - if char in word: - words = [ - self.make_wrappable(w, wrap_limit=wrap_limit, - split_on=split_on) - for w in word.split(char, 1)] - new_words.append(''.join(words)) - break - else: - new_words.append(word) - return ' '.join(new_words) - hide_display_js = r'''