pferd/PFERD/crawlers/__init__.py

20 lines
619 B
Python
Raw Normal View History

2021-05-05 23:45:10 +02:00
from configparser import SectionProxy
from typing import Callable, Dict
from ..conductor import TerminalConductor
2021-05-05 23:45:10 +02:00
from ..config import Config
from ..crawler import Crawler
2021-05-06 01:02:40 +02:00
from .local import LocalCrawler, LocalCrawlerSection
2021-04-29 13:44:29 +02:00
CrawlerConstructor = Callable[[
str, # Name (without the "crawl:" prefix)
SectionProxy, # Crawler's section of global config
Config, # Global config
TerminalConductor, # Global conductor instance
], Crawler]
CRAWLERS: Dict[str, CrawlerConstructor] = {
"local": lambda n, s, c, t:
LocalCrawler(n, LocalCrawlerSection(s), c, t),
2021-04-29 13:44:29 +02:00
}