mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-21 04:41:52 +00:00
Remove unused linkparse.TitleFinder
Stopped being used with removal of UrlBase.set_title_from_content() in:
7b34be59 ("Introduce check plugins, use Python requests for http/s connections, and some code cleanups and improvements.", 2014-03-01)
This commit is contained in:
parent
07cf9c1c11
commit
127c2272c4
1 changed files with 0 additions and 21 deletions
|
|
@ -24,7 +24,6 @@ from . import linkname
|
|||
from builtins import str as str_text
|
||||
|
||||
MAX_NAMELEN = 256
|
||||
MAX_TITLELEN = 256
|
||||
|
||||
unquote = strformat.unquote
|
||||
|
||||
|
|
@ -102,26 +101,6 @@ class StopParse(Exception):
|
|||
pass
|
||||
|
||||
|
||||
class TitleFinder (object):
|
||||
"""Find title tags in HTML text."""
|
||||
|
||||
def __init__ (self):
|
||||
"""Initialize title."""
|
||||
super(TitleFinder, self).__init__()
|
||||
log.debug(LOG_CHECK, "HTML title parser")
|
||||
self.title = None
|
||||
|
||||
def start_element (self, tag, attrs):
|
||||
"""Search for <title> tag."""
|
||||
if tag == 'title':
|
||||
data = self.parser.peek(MAX_TITLELEN)
|
||||
data = data.decode(self.parser.encoding, "ignore")
|
||||
self.title = linkname.title_name(data)
|
||||
raise StopParse("found <title> tag")
|
||||
elif tag == 'body':
|
||||
raise StopParse("found <body> tag")
|
||||
|
||||
|
||||
class TagFinder (object):
|
||||
"""Base class handling HTML start elements.
|
||||
TagFinder instances are used as HtmlParser handlers."""
|
||||
|
|
|
|||
Loading…
Reference in a new issue