MCPcopy
hub / github.com/donnemartin/saws / _process_command

Method _process_command

saws/saws.py:372–394  ·  view source on GitHub ↗

Processes the input command, called by the cli event loop Args: * text: A string that represents the input command text. Returns: None.

(self, text)

Source from the content-addressed store, hash-verified

370 self.aws_cli.input_processor.process_keys()
371
372 def _process_command(self, text):
373 """Processes the input command, called by the cli event loop
374
375 Args:
376 * text: A string that represents the input command text.
377
378 Returns:
379 None.
380 """
381 if AwsCommands.AWS_COMMAND in text:
382 text = self.completer.replace_shortcut(text)
383 if self.handle_docs(text):
384 return
385 try:
386 if not self._handle_cd(text):
387 text = self._colorize_output(text)
388 # Pass the command onto the shell so aws-cli can execute it
389 subprocess.call(text, shell=True)
390 print('')
391 except KeyboardInterrupt as e:
392 self._handle_keyboard_interrupt(e, platform.system())
393 except Exception as e:
394 self.log_exception(e, traceback, echo=True)
395
396 def _create_cli(self):
397 """Creates the prompt_toolkit's CommandLineInterface.

Callers 4

run_cliMethod · 0.95
test_process_commandMethod · 0.80

Calls 6

handle_docsMethod · 0.95
_handle_cdMethod · 0.95
_colorize_outputMethod · 0.95
log_exceptionMethod · 0.95
replace_shortcutMethod · 0.80

Tested by 3

test_process_commandMethod · 0.64