Print URL name in one line.

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3968 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2009-02-18 23:15:43 +00:00
parent 75f1473bf4
commit 06c44542f2
2 changed files with 7 additions and 3 deletions

View file

@ -138,7 +138,7 @@ class TextLogger (Logger):
"""
self.writeln()
self.write(self.part('url') + self.spaces('url'))
txt = u"`%s'" % unicode(url_data.base_url or u"")
txt = strformat.strline(url_data.base_url or u"")
if url_data.cached:
txt += _(" (cached)")
self.writeln(txt, color=self.colorurl)
@ -148,8 +148,7 @@ class TextLogger (Logger):
Write url_data.name.
"""
self.write(self.part("name") + self.spaces("name"))
txt = u"`%s'" % unicode(url_data.name)
self.writeln(txt, color=self.colorname)
self.writeln(strformat.strline(url_data.name), color=self.colorname)
def write_parent (self, url_data):
"""

View file

@ -291,3 +291,8 @@ def limit (s, length=72):
if length == 0:
return ""
return "%s..." % s[:length]
def strline (s):
"""Display string representation on one line."""
return u"`%s'" % unicode(s).replace(u"\n", u"\\n")