MCPcopy
hub / github.com/scrapy/scrapy / _get_commands_from_entry_points

Function _get_commands_from_entry_points

scrapy/cmdline.py:63–73  ·  view source on GitHub ↗
(
    inproject: bool, group: str = "scrapy.commands"
)

Source from the content-addressed store, hash-verified

61
62
63def _get_commands_from_entry_points(
64 inproject: bool, group: str = "scrapy.commands"
65) -> dict[str, ScrapyCommand]:
66 cmds: dict[str, ScrapyCommand] = {}
67 for entry_point in entry_points(group=group):
68 obj = entry_point.load()
69 if inspect.isclass(obj):
70 cmds[entry_point.name] = obj()
71 else:
72 raise ValueError(f"Invalid entry point {entry_point.name}")
73 return cmds
74
75
76def _get_commands_dict(

Callers 1

_get_commands_dictFunction · 0.85

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected