mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-25 00:24:45 +00:00
Ignore URLs earlier.
This commit is contained in:
parent
887a814d42
commit
40b663cf9e
2 changed files with 6 additions and 4 deletions
|
|
@ -23,6 +23,6 @@ from . import unknownurl
|
|||
class IgnoreUrl (unknownurl.UnknownUrl):
|
||||
"""Always ignored URL."""
|
||||
|
||||
def ignored (self):
|
||||
def is_ignored (self):
|
||||
"""Return True if this URL scheme is ignored."""
|
||||
return True
|
||||
|
|
|
|||
|
|
@ -137,16 +137,18 @@ is_unknown_scheme = ignored_schemes_re.match
|
|||
class UnknownUrl (urlbase.UrlBase):
|
||||
"""Handle unknown or just plain broken URLs."""
|
||||
|
||||
def local_check (self):
|
||||
def build_url (self):
|
||||
"""Only logs that this URL is unknown."""
|
||||
if self.ignored():
|
||||
super(UnknownUrl, self).build_url()
|
||||
if self.is_ignored():
|
||||
self.add_info(_("%(scheme)s URL ignored.") %
|
||||
{"scheme": self.scheme.capitalize()})
|
||||
self.set_result(_("ignored"))
|
||||
else:
|
||||
self.set_result(_("URL is unrecognized or has invalid syntax"),
|
||||
valid=False)
|
||||
|
||||
def ignored (self):
|
||||
def is_ignored (self):
|
||||
"""Return True if this URL scheme is ignored."""
|
||||
return is_unknown_scheme(self.scheme)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue