command-executor

Latest Version Coverage Status Documentation Status https://travis-ci.org/moccu/python-command-executor.svg?branch=master

Usage

Please refer to the Documentation to learn how to use command-executor. Basicly, command_executor provides some Python classes to make it easier to start processes / commands and handling errors and output. In addition, input validation for command parameters is possible.

Requirements

python-command-executor supports Python 3 only. No other dependencies are required.

Prepare for development

A Python 3.6 interpreter is required in addition to pipenv.

$ pipenv install --python 3.6
$ pipenv shell
$ pip install -e .

Now you’re ready to run the tests:

$ pipenv run py.test

All Contents

Usage

Note

TODO: Add usage examples for command classes.

API Reference

Command

class command_executor.command.Command(**kwargs)[source]

Bases: object

process = None[source]
command = 'true'[source]
ignore_output = True[source]
fail_silently = False[source]
required_parameters = None[source]
stdout = -1[source]
stderr = -1[source]
execute(ignore_output=None, fail_silently=None, stdin=None, **kwargs)[source]
validate_parameters()[source]
get_parameters()[source]
get_command()[source]
handle_output(output)[source]
pid[source]

Exceptions

exception command_executor.exceptions.CommandError[source]

Bases: Exception

exception command_executor.exceptions.CommandExecutionError(code, stderr, command)[source]

Bases: command_executor.exceptions.CommandError

exception command_executor.exceptions.CommandParameterError[source]

Bases: command_executor.exceptions.CommandError

Changelog

0.1.0 - 2019-01-10

  • Improved support for background / forking processes.

0.0.1 - 2018-08-08

  • Initial release of command-executor

Indices and tables