mirror of
https://github.com/Garmelon/PFERD.git
synced 2025-10-20 00:32:33 +02:00
Fix mypy errors
This commit is contained in:
@@ -985,8 +985,6 @@ instance's greatest bottleneck.
|
|||||||
"""
|
"""
|
||||||
log.explain_topic("Internalizing images")
|
log.explain_topic("Internalizing images")
|
||||||
for elem in tag.find_all(recursive=True):
|
for elem in tag.find_all(recursive=True):
|
||||||
if not isinstance(elem, Tag):
|
|
||||||
continue
|
|
||||||
if elem.name == "img":
|
if elem.name == "img":
|
||||||
if src := elem.attrs.get("src", None):
|
if src := elem.attrs.get("src", None):
|
||||||
url = urljoin(self._base_url, cast(str, src))
|
url = urljoin(self._base_url, cast(str, src))
|
||||||
|
@@ -435,7 +435,7 @@ class IliasPage:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def get_description(self) -> Optional[BeautifulSoup]:
|
def get_description(self) -> Optional[BeautifulSoup]:
|
||||||
def is_interesting_class(name: str) -> bool:
|
def is_interesting_class(name: str | None) -> bool:
|
||||||
return name in [
|
return name in [
|
||||||
"ilCOPageSection", "ilc_Paragraph", "ilc_va_ihcap_VAccordIHeadCap",
|
"ilCOPageSection", "ilc_Paragraph", "ilc_va_ihcap_VAccordIHeadCap",
|
||||||
"ilc_va_ihcap_AccordIHeadCap", "ilc_media_cont_MediaContainer"
|
"ilc_va_ihcap_AccordIHeadCap", "ilc_media_cont_MediaContainer"
|
||||||
@@ -1243,7 +1243,7 @@ class IliasPage:
|
|||||||
# In a series of divs.
|
# In a series of divs.
|
||||||
# Find the parent containing all those divs, so we can filter our what we need
|
# 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(
|
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"))
|
)).select_one(".il_ItemProperties"))
|
||||||
# The first one is always the filetype
|
# The first one is always the filetype
|
||||||
file_type = cast(Tag, properties_parent.select_one("span.il_ItemProperty")).get_text().strip()
|
file_type = cast(Tag, properties_parent.select_one("span.il_ItemProperty")).get_text().strip()
|
||||||
|
Reference in New Issue
Block a user