Adjust ILIAS html explain messages

This commit is contained in:
I-Al-Istannen 2021-05-23 18:22:29 +02:00
parent a9af56a5e9
commit 79efdb56f7
2 changed files with 7 additions and 5 deletions

View File

@ -52,12 +52,12 @@ class IliasPage:
log.explain("Page is a video player, extracting URL")
return self._player_to_video()
if self._is_video_listing():
log.explain("Page is a video listing, finding elements")
log.explain("Page is a video listing, searching for elements")
return self._find_video_entries()
if self._is_exercise_file():
log.explain("Page is an exercise, finding elements")
log.explain("Page is an exercise, searching for elements")
return self._find_exercise_entries()
log.explain("Page is a normal folder, finding elements")
log.explain("Page is a normal folder, searching for elements")
return self._find_normal_entries()
def _is_video_player(self) -> bool:

View File

@ -206,6 +206,8 @@ class KitIliasWebCrawler(HttpCrawler):
raise CrawlError("Invalid course id? Didn't find anything looking like a course")
# Duplicated code, but the root page is special - we want to avoid fetching it twice!
log.explain_topic("Parsing root HTML page")
log.explain(f"URL: {url}")
page = IliasPage(soup, url, None)
elements.extend(page.get_child_elements())
@ -229,8 +231,8 @@ class KitIliasWebCrawler(HttpCrawler):
elements.clear()
async with cl:
soup = await self._get_page(url)
log.explain_topic(f"Parsing HTML page for {path!r}")
log.explain(f"URL: {url!r}")
log.explain_topic(f"Parsing HTML page for {fmt_path(path)}")
log.explain(f"URL: {url}")
page = IliasPage(soup, url, parent)
elements.extend(page.get_child_elements())