* ietf/tests.py: Remove filetime() again -- not using it.

* ietf/utils/soup2text.py: Do line ending normalization.
 - Legacy-Id: 315
This commit is contained in:
Henrik Levkowetz 2007-06-11 17:26:59 +00:00
parent 9a9f375ec3
commit 8e8c3ff5e2
2 changed files with 3 additions and 7 deletions

View file

@ -76,12 +76,6 @@ def filetext(filename):
file.close()
return chunk
def filetime(name):
if os.path.exists(name):
return os.stat(name)[stat.ST_MTIME]
else:
return 0
class UrlTestCase(TestCase):
def setUp(self):
from django.test.client import Client

View file

@ -98,8 +98,10 @@ class TextSoup(BeautifulSoup):
return str
def soup2text(html):
# Line ending normalization
html = html.replace("\r\n", "\n").replace("\r", "\n")
# some preprocessing to handle common pathological cases
html = re.sub("<br */?>[ \t\r\n]*(<br */?>)+", "<p/>", html)
html = re.sub("<br */?>[ \t\n]*(<br */?>)+", "<p/>", html)
soup = TextSoup(html)
return str(soup)