diff --git a/linkcheck/checker/__init__.py b/linkcheck/checker/__init__.py index 1b5b1f1e..c01b5bd9 100644 --- a/linkcheck/checker/__init__.py +++ b/linkcheck/checker/__init__.py @@ -56,6 +56,7 @@ ExcList = [ ftplib.error_perm, ftplib.error_proto, ] +# XXX remove this when depending on python >= 2.4 if hasattr(socket, "sslerror"): ExcList.append(socket.sslerror) diff --git a/linkcheck/checker/httpsurl.py b/linkcheck/checker/httpsurl.py index 5510880f..2225b9e7 100644 --- a/linkcheck/checker/httpsurl.py +++ b/linkcheck/checker/httpsurl.py @@ -29,3 +29,4 @@ class HttpsUrl (httpurl.HttpUrl): else: self.add_warning(_("%s url ignored")%self.scheme.capitalize()) self.consumer.logger_new_url(self) + self.consumer.cache.url_data_cache_add(self) diff --git a/linkcheck/checker/httpurl.py b/linkcheck/checker/httpurl.py index 3899bac2..e78fc138 100644 --- a/linkcheck/checker/httpurl.py +++ b/linkcheck/checker/httpurl.py @@ -246,6 +246,7 @@ class HttpUrl (urlbase.UrlBase, proxysupport.ProxySupport): _("recursive redirection encountered:\n %s") % \ "\n => ".join(redirect_cache), valid=False) self.consumer.logger_new_url(self) + self.consumer.cache.url_data_cache_add(self) return -1, response redirect_cache.append(redirected) # remember this alias diff --git a/linkcheck/checker/ignoredurl.py b/linkcheck/checker/ignoredurl.py index 2bf8323c..26005efa 100644 --- a/linkcheck/checker/ignoredurl.py +++ b/linkcheck/checker/ignoredurl.py @@ -26,6 +26,7 @@ class IgnoredUrl (urlbase.UrlBase): def local_check (self): self.add_warning(_("%s url ignored")%self.scheme.capitalize()) self.consumer.logger_new_url(self) + self.consumer.cache.url_data_cache_add(self) def can_get_content (self): return False diff --git a/linkcheck/checker/telneturl.py b/linkcheck/checker/telneturl.py index de6a1a50..977ac652 100644 --- a/linkcheck/checker/telneturl.py +++ b/linkcheck/checker/telneturl.py @@ -44,6 +44,7 @@ class TelnetUrl (urlbase.UrlBase): if not self.host: self.set_result(_("Host is empty"), valid=False) self.consumer.logger_new_url(self) + self.consumer.cache.url_data_cache_add(self) return super(TelnetUrl, self).local_check() diff --git a/linkcheck/checker/urlbase.py b/linkcheck/checker/urlbase.py index 7236bc8f..425abb16 100644 --- a/linkcheck/checker/urlbase.py +++ b/linkcheck/checker/urlbase.py @@ -217,6 +217,12 @@ class UrlBase (object): return urlparse.urlunsplit(self.urlparts[:4]+['']) return None + def is_cached_or_queued (self): + """look if this URL is already stored in the Cache or is pending + in the URL queue""" + return self.consumer.url_is_queued(self.get_cache_key()) or \ + self.is_cached() + def is_cached (self): """look if this URL is already stored in the Cache""" return self.consumer.cache.url_is_cached(self.get_cache_key()) @@ -294,6 +300,7 @@ class UrlBase (object): self.add_info( _("outside of domain filter, checked only syntax")) self.consumer.logger_new_url(self) + self.consumer.cache.url_data_cache_add(self) return # check connection