mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-11 16:13:11 +00:00
prepare filenames as URLs
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3264 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
0ba1520d13
commit
14a29fb015
1 changed files with 4 additions and 5 deletions
|
|
@ -102,9 +102,8 @@ def get_file (filename=None):
|
|||
return unicode(directory)
|
||||
|
||||
|
||||
def get_file_url ():
|
||||
filename = get_file().replace("\\", "/")
|
||||
return re.sub("^file://(/?)([a-zA-Z]):", r"file:///\2|", filename)
|
||||
def get_file_url (filename):
|
||||
return re.sub("^([a-zA-Z]):", r"/\1|", filename.replace("\\", "/"))
|
||||
|
||||
|
||||
def get_test_aggregate (confargs, logargs):
|
||||
|
|
@ -143,8 +142,8 @@ class LinkCheckTest (unittest.TestCase):
|
|||
ignoring empty lines and lines starting with a hash sign (#).
|
||||
"""
|
||||
resultfile = get_file(filename+".result")
|
||||
d = {'curdir': os.getcwd(),
|
||||
'datadir': get_file_url(),
|
||||
d = {'curdir': get_file_url(os.getcwd()),
|
||||
'datadir': get_file_url(get_file()),
|
||||
}
|
||||
f = codecs.open(resultfile, "r", "iso-8859-15")
|
||||
resultlines = [line.rstrip('\r\n') % d for line in f \
|
||||
|
|
|
|||
Loading…
Reference in a new issue