(module_name: str)
| 38 | |
| 39 | |
| 40 | def _iter_command_classes(module_name: str) -> Iterable[type[ScrapyCommand]]: |
| 41 | # TODO: add `name` attribute to commands and merge this function with |
| 42 | # scrapy.utils.spider.iter_spider_classes |
| 43 | for module in walk_modules_iter(module_name): |
| 44 | for obj in vars(module).values(): |
| 45 | if ( |
| 46 | inspect.isclass(obj) |
| 47 | and issubclass(obj, ScrapyCommand) |
| 48 | and obj.__module__ == module.__name__ |
| 49 | and obj not in {ScrapyCommand, BaseRunSpiderCommand} |
| 50 | ): |
| 51 | yield obj |
| 52 | |
| 53 | |
| 54 | def _get_commands_from_module(module: str, inproject: bool) -> dict[str, ScrapyCommand]: |
no test coverage detected