From 114e5f288dd06eefbcc178303a4062ed26912551 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 6 Oct 2024 19:28:03 +0530 Subject: [PATCH] Remove some typecheck imports for bs4 calibre BeautifulSoup is not necessarily bs4 BeautifulSoup, though derived from it. --- recipes/fokus.recipe | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/recipes/fokus.recipe b/recipes/fokus.recipe index ed306dff0a..20321d5efe 100644 --- a/recipes/fokus.recipe +++ b/recipes/fokus.recipe @@ -2,9 +2,6 @@ # vim:fileencoding=utf-8 from datetime import datetime, timezone -from bs4 import BeautifulSoup -from bs4.element import Tag - from calibre.web.feeds.news import BasicNewsRecipe @@ -112,7 +109,7 @@ class Fokus(BasicNewsRecipe): self.log(f'Identified a total of {len(section_urls_and_names)} unique sections.') return section_urls_and_names - def parse_article_blurb(self, article_blurb: Tag) -> dict[str, str, str, str] | None: + def parse_article_blurb(self, article_blurb) -> dict[str, str, str, str] | None: """Given a
tag of class 'Blurb', parse it into a dict. Args: @@ -149,7 +146,7 @@ class Fokus(BasicNewsRecipe): return {'url': url, 'title': title, 'description': desc, 'date': swedish_date_str} return - def _get_article_blurbs(self, soup: BeautifulSoup) -> dict[str, dict[str, str, str, str]]: + def _get_article_blurbs(self, soup) -> dict[str, dict[str, str, str, str]]: """Given a Fokus webpage `soup`, return a dict of unique article entries found on the page. The key of a given entry in the output dictionary is the article URL. The corresponding value is a dictionary