MCPcopy
hub / github.com/awslabs/aws-shell / run

Method run

awsshell/app.py:88–111  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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
114class ProfileHandler(object):

Callers 2

test_edit_handlerFunction · 0.95

Calls 3

_get_editor_commandMethod · 0.95
temporary_fileFunction · 0.90

Tested by 2

test_edit_handlerFunction · 0.76