platypush.plugins.shell

class platypush.plugins.shell.ShellPlugin(**kwargs)[source]

Plugin to run custom shell commands.

exec(cmd, ignore_errors=False)[source]

Execute a command.

Parameters:
  • cmd (str) – Command to execute
  • ignore_errors – If set, then any errors in the command execution will be ignored. Otherwise a RuntimeError will be thrown (default value: False)
Returns:

A response object where the output field will contain the command output as a string, and the errors field will contain whatever was sent to stderr.