(self, message: str)
| 101 | ) |
| 102 | |
| 103 | def manual_edit(self, message: str) -> str: |
| 104 | editor = git.get_core_editor() |
| 105 | if editor is None: |
| 106 | raise RuntimeError("No 'editor' value given and no default available.") |
| 107 | exec_path = shutil.which(editor) |
| 108 | if exec_path is None: |
| 109 | raise RuntimeError(f"Editor '{editor}' not found.") |
| 110 | with tempfile.NamedTemporaryFile(mode="w", delete=False) as file: |
| 111 | file.write(message) |
| 112 | file_path = file.name |
| 113 | argv = [exec_path, file_path] |
| 114 | subprocess.call(argv) |
| 115 | message = Path(file_path).read_text().strip() |
| 116 | os.unlink(file.name) |
| 117 | return message |
| 118 | |
| 119 | def _get_message(self) -> str: |
| 120 | if self.arguments.get("retry"): |
no outgoing calls