mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-28 03:30:36 +00:00
documentation
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1480 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
0d86239c4b
commit
0de757b5eb
1 changed files with 9 additions and 5 deletions
|
|
@ -187,6 +187,7 @@ class UrlBase (object):
|
|||
}
|
||||
|
||||
def get_cache_keys (self):
|
||||
"""return cache key plus all aliases for caching in a list"""
|
||||
key = self.get_cache_key()
|
||||
if key is None:
|
||||
return []
|
||||
|
|
@ -196,7 +197,10 @@ class UrlBase (object):
|
|||
return self.consumer.cache.url_is_cached(self.get_cache_key())
|
||||
|
||||
def get_cache_key (self):
|
||||
# note: the host is already lowercase
|
||||
"""Get key to store this url data in the cache. Note that
|
||||
this method is only called after self.build_url() succeeds.
|
||||
"""
|
||||
assert self.anchor is not None
|
||||
if self.urlparts:
|
||||
if self.consumer.config["anchorcaching"]:
|
||||
# do not ignore anchor
|
||||
|
|
@ -223,14 +227,14 @@ class UrlBase (object):
|
|||
self.urlparts = list(urlparse.urlsplit(self.url))
|
||||
# check userinfo@host:port syntax
|
||||
self.userinfo, host = urllib.splituser(self.urlparts[1])
|
||||
x, port = urllib.splitport(host)
|
||||
if port is not None and not linkcheck.url.is_numeric_port(port):
|
||||
raise linkcheck.LinkCheckerError(_("URL has invalid port %r") %\
|
||||
str(port))
|
||||
# set host lowercase and without userinfo
|
||||
self.urlparts[1] = host.lower()
|
||||
# safe anchor for later checking
|
||||
self.anchor = self.urlparts[4]
|
||||
x, port = urllib.splitport(host)
|
||||
if port is not None and not linkcheck.url.is_numeric_port(port):
|
||||
raise linkcheck.LinkCheckerError(_("URL has invalid port %r") %\
|
||||
str(port))
|
||||
|
||||
def check (self):
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in a new issue