MCPcopy
hub / github.com/pallets/click / get_editor

Method get_editor

src/click/_termui_impl.py:669–684  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

667 self.extension = extension
668
669 def get_editor(self) -> str:
670 if self.editor is not None:
671 return self.editor
672 for key in "VISUAL", "EDITOR":
673 rv = os.environ.get(key)
674 if rv:
675 return rv
676 if WIN:
677 return "notepad"
678
679 from shutil import which
680
681 for editor in "sensible-editor", "vim", "nano":
682 if which(editor) is not None:
683 return editor
684 return "vi"
685
686 def edit_files(self, filenames: cabc.Iterable[str]) -> None:
687 """Open files in the user's editor."""

Callers 1

edit_filesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected