Open application's history buffer in an editor. :type command: list :param command: The dot command as a list split on whitespace, e.g ``['.foo', 'arg1', 'arg2']`` :type application: AWSShell :param application: The application object.
(self, command, application)
| 86 | return '\n'.join(commands) |
| 87 | |
| 88 | def run(self, command, application): |
| 89 | """Open application's history buffer in an editor. |
| 90 | |
| 91 | :type command: list |
| 92 | :param command: The dot command as a list split |
| 93 | on whitespace, e.g ``['.foo', 'arg1', 'arg2']`` |
| 94 | |
| 95 | :type application: AWSShell |
| 96 | :param application: The application object. |
| 97 | |
| 98 | """ |
| 99 | with temporary_file('w') as f: |
| 100 | all_commands = self._generate_edit_history(application) |
| 101 | f.write(all_commands) |
| 102 | f.flush() |
| 103 | editor = self._get_editor_command() |
| 104 | try: |
| 105 | p = self._popen_cls([editor, f.name]) |
| 106 | p.communicate() |
| 107 | except OSError: |
| 108 | self._err.write("Unable to launch editor: %s\n" |
| 109 | "You can configure which editor to use by " |
| 110 | "exporting the EDITOR environment variable.\n" |
| 111 | % editor) |
| 112 | |
| 113 | |
| 114 | class ProfileHandler(object): |