From 127c2272c411152c88c2846c0a4c7477c802e9d6 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Sat, 5 Oct 2019 19:37:54 +0100 Subject: [PATCH] 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) --- linkcheck/htmlutil/linkparse.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/linkcheck/htmlutil/linkparse.py b/linkcheck/htmlutil/linkparse.py index 32c7c1c2..ca4700bc 100644 --- a/linkcheck/htmlutil/linkparse.py +++ b/linkcheck/htmlutil/linkparse.py @@ -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 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."""