(self)
| 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.""" |