MCPcopy Create free account
hub / github.com/ipython/ipython / call_editor

Function call_editor

IPython/lib/editorhooks.py:47–59  ·  view source on GitHub ↗
(self, filename, line=0)

Source from the content-addressed store, hash-verified

45 # run_template)))
46
47 def call_editor(self, filename, line=0):
48 if line is None:
49 line = 0
50 cmd = template.format(filename=pipes.quote(filename), line=line)
51 print(">", cmd)
52 # pipes.quote doesn't work right on Windows, but it does after splitting
53 if sys.platform.startswith('win'):
54 cmd = shlex.split(cmd)
55 proc = subprocess.Popen(cmd, shell=True)
56 if proc.wait() != 0:
57 raise TryNext()
58 if wait:
59 py3compat.input("Press Enter when done editing:")
60
61 get_ipython().set_hook('editor', call_editor)
62 get_ipython().editor = template

Callers

nothing calls this directly

Calls 3

TryNextClass · 0.90
waitMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected