MCPcopy
hub / github.com/scrapy/scrapy / run

Method run

scrapy/commands/edit.py:32–48  ·  view source on GitHub ↗
(self, args: list[str], opts: argparse.Namespace)

Source from the content-addressed store, hash-verified

30 self.exitcode = 1
31
32 def run(self, args: list[str], opts: argparse.Namespace) -> None:
33 if len(args) != 1:
34 raise UsageError
35
36 assert self.settings is not None
37 editor = self.settings["EDITOR"]
38 spider_loader = get_spider_loader(self.settings)
39 try:
40 spidercls = spider_loader.load(args[0])
41 except KeyError:
42 self._err(f"Spider not found: {args[0]}")
43 return
44
45 sfile = sys.modules[spidercls.__module__].__file__
46 assert sfile
47 sfile = sfile.replace(".pyc", ".py")
48 self.exitcode = os.system(f'{editor} "{sfile}"') # noqa: S605

Callers

nothing calls this directly

Calls 4

_errMethod · 0.95
get_spider_loaderFunction · 0.90
loadMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected