Fix mypy errors

This commit is contained in:
I-Al-Istannen
2025-10-19 15:08:21 +02:00
parent 207af51aa4
commit f6c713d621
2 changed files with 2 additions and 4 deletions

View File

@@ -985,8 +985,6 @@ instance's greatest bottleneck.
"""
log.explain_topic("Internalizing images")
for elem in tag.find_all(recursive=True):
if not isinstance(elem, Tag):
continue
if elem.name == "img":
if src := elem.attrs.get("src", None):
url = urljoin(self._base_url, cast(str, src))

View File

@@ -435,7 +435,7 @@ class IliasPage:
return None
def get_description(self) -> Optional[BeautifulSoup]:
def is_interesting_class(name: str) -> bool:
def is_interesting_class(name: str | None) -> bool:
return name in [
"ilCOPageSection", "ilc_Paragraph", "ilc_va_ihcap_VAccordIHeadCap",
"ilc_va_ihcap_AccordIHeadCap", "ilc_media_cont_MediaContainer"
@@ -1243,7 +1243,7 @@ class IliasPage:
# In a series of divs.
# Find the parent containing all those divs, so we can filter our what we need
properties_parent = cast(Tag, cast(Tag, link_element.find_parent(
"div", {"class": lambda x: "il_ContainerListItem" in x}
"div", {"class": lambda x: x is not None and "il_ContainerListItem" in x}
)).select_one(".il_ItemProperties"))
# The first one is always the filetype
file_type = cast(Tag, properties_parent.select_one("span.il_ItemProperty")).get_text().strip()