From bdf17f5c870a51a8bfe7a2072ab17b6c1e66d11c Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Wed, 23 Apr 2025 16:03:37 +0200 Subject: [PATCH] Ignore wikis --- CHANGELOG.md | 3 +++ PFERD/crawl/ilias/ilias_web_crawler.py | 8 ++++++++ PFERD/crawl/ilias/kit_ilias_html.py | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index af5bcfb..2bc00b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,9 @@ ambiguous situations. ## Unreleased +## Changed +- Explicitly mention that wikis are not supported at the moment and ignore them + ## 3.8.1 - 2025-04-17 ## Fixed diff --git a/PFERD/crawl/ilias/ilias_web_crawler.py b/PFERD/crawl/ilias/ilias_web_crawler.py index 52ecf92..8ba959a 100644 --- a/PFERD/crawl/ilias/ilias_web_crawler.py +++ b/PFERD/crawl/ilias/ilias_web_crawler.py @@ -424,6 +424,14 @@ instance's greatest bottleneck. "[bright_black](not descending into linked course)" ) return None + elif element.type == IliasElementType.WIKI: + log.status( + "[bold bright_black]", + "Ignored", + fmt_path(element_path), + "[bright_black](wikis are not currently supported)" + ) + return None elif element.type == IliasElementType.LEARNING_MODULE: return await self._handle_learning_module(element, element_path) elif element.type == IliasElementType.LINK: diff --git a/PFERD/crawl/ilias/kit_ilias_html.py b/PFERD/crawl/ilias/kit_ilias_html.py index 5ea17d6..6d3e487 100644 --- a/PFERD/crawl/ilias/kit_ilias_html.py +++ b/PFERD/crawl/ilias/kit_ilias_html.py @@ -120,6 +120,7 @@ class IliasElementType(Enum): SCORM_LEARNING_MODULE = "scorm_learning_module" SURVEY = "survey" TEST = "test" # an online test. Will be ignored currently. + WIKI = "wiki" def matcher(self) -> IliasElementMatcher: match self: @@ -243,6 +244,11 @@ class IliasElementType(Enum): TypeMatcher.query("cmdclass=iltestscreengui"), TypeMatcher.img_src("_tst.svg") ) + case IliasElementType.WIKI: + return TypeMatcher.any( + TypeMatcher.query("baseClass=ilwikihandlergui"), + TypeMatcher.img_src("wiki.svg") + ) raise CrawlWarning(f"Unknown matcher {self}")