MCPcopy Index your code
hub / github.com/ipython/ipython / _edit_macro

Method _edit_macro

IPython/core/magics/code.py:537–544  ·  view source on GitHub ↗

open an editor with the macro data in a file

(self,mname,macro)

Source from the content-addressed store, hash-verified

535 return filename, lineno, use_temp
536
537 def _edit_macro(self,mname,macro):
538 """open an editor with the macro data in a file"""
539 filename = self.shell.mktempfile(macro.value)
540 self.shell.hooks.editor(filename)
541
542 # and make a new macro object, to replace the old one
543 mvalue = Path(filename).read_text(encoding="utf-8")
544 self.shell.user_ns[mname] = Macro(mvalue)
545
546 @skip_doctest
547 @line_magic

Callers 1

editMethod · 0.95

Calls 2

MacroClass · 0.90
mktempfileMethod · 0.80

Tested by

no test coverage detected