dav_tools.commands ================== .. py:module:: dav_tools.commands .. autoapi-nested-parse:: External command execution on local machine. Functions --------- .. autoapisummary:: dav_tools.commands.execute dav_tools.commands.get_output dav_tools.commands.is_installed Module Contents --------------- .. py:function:: execute(command, stdin=_sys.stdin, stdout=_sys.stdout, stderr=_sys.stderr) Run a command. :param command: the command to execute :param stdin: input redirection :param stdout: output redirection :param stderr: error redirection :returns: `True` if the command exits with return code zero, `False` otherwise .. py:function:: get_output(command, on_success = lambda x: x, on_error = None, stdin=_sys.stdin, stderr=_sys.stderr) Run a command and return its output. :param command: the command to execute :param on_success: call the specified function on the output before returning the data. Useful for casting the output from its original `bytes` format :param on_error: call the specified function if the command raised an exception. If this value is `None`, raises the exception. :param stdin: input redirection :param stderr: error redirection .. py:function:: is_installed(command) Check if a command is installed on the system. :param command: the command to check :returns: `True` if the command is installed, `False` otherwise