mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-02 03:44:43 +00:00
log cache keys, ignore empty and comment lines in result files
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1470 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
d24d8a512c
commit
833201711d
1 changed files with 7 additions and 2 deletions
|
|
@ -50,6 +50,8 @@ class TestLogger (linkcheck.logger.Logger):
|
|||
if url_data.cached:
|
||||
url += " (cached)"
|
||||
self.result.append(url)
|
||||
if self.has_field('cachekey'):
|
||||
self.result.append("cache key %s" % url_data.get_cache_key())
|
||||
if self.has_field('realurl'):
|
||||
self.result.append("real url %s" % url_data.url)
|
||||
if self.has_field('name') and url_data.name:
|
||||
|
|
@ -107,11 +109,14 @@ class StandardTest (unittest.TestCase):
|
|||
return os.path.join("linkcheck", "ftests", "data", filename)
|
||||
|
||||
def get_resultlines (self, filename):
|
||||
"""return contents of file, as list of lines"""
|
||||
"""return contents of file, as list of lines without line endings,
|
||||
ignoring empty lines and lines starting with a hash sign (#).
|
||||
"""
|
||||
resultfile = self.get_file(filename+".result")
|
||||
f = open(resultfile)
|
||||
resultlines = [line.rstrip('\r\n') % {'curdir': os.getcwd()} \
|
||||
for line in f]
|
||||
for line in f \
|
||||
if line.strip() and not line.startswith('#')]
|
||||
f.close()
|
||||
return resultlines
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue