Import fetchers
This commit is contained in:
parent
595640efdf
commit
36b372fb2d
|
@ -7,6 +7,10 @@ from personal_data.notification import NotificationType
|
||||||
|
|
||||||
def parse_arguments():
|
def parse_arguments():
|
||||||
available_scraper_names = personal_data.main.available_scraper_names()
|
available_scraper_names = personal_data.main.available_scraper_names()
|
||||||
|
if len(available_scraper_names) == 0:
|
||||||
|
msg = 'Failed to load any scrapers'
|
||||||
|
raise Exception(msg)
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
epilog='Available fetchers: ' + ' '.join(available_scraper_names),
|
epilog='Available fetchers: ' + ' '.join(available_scraper_names),
|
||||||
)
|
)
|
||||||
|
|
|
@ -64,6 +64,7 @@ def get_session(
|
||||||
|
|
||||||
|
|
||||||
def available_scrapers() -> list[type[data.Scraper]]:
|
def available_scrapers() -> list[type[data.Scraper]]:
|
||||||
|
from . import fetchers
|
||||||
subclasses = []
|
subclasses = []
|
||||||
class_queue = [data.Scraper]
|
class_queue = [data.Scraper]
|
||||||
while class_queue:
|
while class_queue:
|
||||||
|
|
7
test/test_main.py
Normal file
7
test/test_main.py
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
import personal_data.main
|
||||||
|
|
||||||
|
|
||||||
|
def test_available():
|
||||||
|
names = personal_data.main.available_scraper_names()
|
||||||
|
assert len(names) > 0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user