Full typing for scrapy/spiderloader.py.

This commit is contained in:
Andrey Rakhmatullin 2023-08-07 00:35:44 +04:00
parent 084a9ba076
commit dc6e142096
1 changed files with 3 additions and 3 deletions

View File

@ -27,8 +27,8 @@ class SpiderLoader:
"""
def __init__(self, settings: BaseSettings):
self.spider_modules = settings.getlist("SPIDER_MODULES")
self.warn_only = settings.getbool("SPIDER_LOADER_WARN_ONLY")
self.spider_modules: List[str] = settings.getlist("SPIDER_MODULES")
self.warn_only: bool = settings.getbool("SPIDER_LOADER_WARN_ONLY")
self._spiders: Dict[str, Type[Spider]] = {}
self._found: DefaultDict[str, List[Tuple[str, str]]] = defaultdict(list)
self._load_all_spiders()
@ -96,7 +96,7 @@ class SpiderLoader:
name for name, cls in self._spiders.items() if cls.handles_request(request)
]
def list(self):
def list(self) -> List[str]:
"""
Return a list with the names of all spiders available in the project.
"""