diff --git a/AUTHORS.rst b/AUTHORS.rst index 170cb67..e33964b 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -2,10 +2,7 @@ Credits ======= -Development Lead ----------------- - -* Markus Gerstel +* Markus Gerstel Contributors ------------ diff --git a/HISTORY.rst b/HISTORY.rst index 8d5d7a5..c33e68a 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,6 +1,16 @@ ======= History ======= + +0.3.0 +----- + +* run_process() renamed to run() + +0.2.0 (2018-03-12) +------------------ + +* Procrunner is now Python3 3.3-3.6 compatible. 0.1.0 (2018-03-12) ------------------ diff --git a/README.rst b/README.rst index 2d9f839..d60ec02 100644 --- a/README.rst +++ b/README.rst @@ -30,7 +30,18 @@ Features -------- -* TODO +* runs an external process and waits for it to finish +* does not deadlock, no matter the process stdout/stderr output behaviour +* returns the exit code, stdout, stderr (separately), and the total process + runtime as a dictionary +* process can run in a custom environment, either as a modification of + the current environment or in a new environment from scratch +* stdin can be fed to the process, the returned dictionary contains + information how much was read by the process +* stdout and stderr is printed by default, can be disabled +* stdout and stderr can be passed to any arbitrary function for + live processing +* optionally enforces a time limit on the process Credits ------- diff --git a/docs/api.rst b/docs/api.rst new file mode 100644 index 0000000..52d4b1b --- /dev/null +++ b/docs/api.rst @@ -0,0 +1,8 @@ +=== +API +=== + +.. automodule:: procrunner + :members: + :show-inheritance: + diff --git a/docs/index.rst b/docs/index.rst index 13730c2..33a2dce 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -8,13 +8,11 @@ readme installation usage - modules + api contributing authors history Indices and tables ================== -* :ref:`genindex` -* :ref:`modindex` * :ref:`search` diff --git a/docs/usage.rst b/docs/usage.rst index 0b7c8de..3ae18c8 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -5,3 +5,20 @@ To use ProcRunner in a project:: import procrunner + result = procrunner.run(['/bin/ls', '/some/path/containing spaces']) + +To test for successful completion:: + + assert result['exitcode'] == 0 + +To test for no STDERR output:: + + assert result['stderr'] == '' + +To run with a specific environment variable set:: + + result = procrunner.run(..., environment_override={ 'VARIABLE': 'value' }) + +To run with a specific environment:: + + result = procrunner.run(..., environment={ 'VARIABLE': 'value' })