only cache anchor urls with -a

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@809 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2003-03-05 11:34:40 +00:00
parent 21d8c11b28
commit 9676d14c89

View file

@ -172,7 +172,7 @@ class UrlData:
self.url = urlparse.urljoin(self.baseRef, self.urlName)
elif self.parentName:
self.url = urlparse.urljoin(self.parentName, self.urlName)
else:
else:
self.url = self.urlName
# unquote url
self.url = urllib.unquote(self.url)
@ -308,9 +308,14 @@ class UrlData:
def getCacheKey (self):
# use that the host is lowercase
# remember that the host is lowercase
if self.urlparts:
return urlparse.urlunsplit(self.urlparts)
if self.config["anchors"]:
# do not ignore anchor
return urlparse.urlunsplit(self.urlparts)
else:
# remove anchor from cache key
return urlparse.urlunsplit(self.urlparts[:4]+[''])
return None