feat: completely dynamified the datasource import
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2024-05-24 17:00:39 +02:00
parent 5af95f1b03
commit 0f2229b0f2
2 changed files with 42 additions and 11 deletions

View File

@@ -78,8 +78,6 @@ class Downloader:
if page_type in self._registered_pages:
return
print(page_type)
self._registered_pages[page_type].add(page_type(
download_options=self.download_options,
fetch_options=self.fetch_options,
@@ -97,6 +95,7 @@ class Downloader:
def scan_for_pages(self, **kwargs):
# assuming the wanted pages are the leaf classes of the interface
from .. import pages
leaf_classes = []
class_list = [Page]
@@ -110,6 +109,9 @@ class Downloader:
else:
class_list.extend(class_subclasses)
if Page in leaf_classes:
self.LOGGER.warn("couldn't find any data source")
return
for leaf_class in leaf_classes:
self.register_page(leaf_class, **kwargs)