Package list python-procrunner / cb70ecf
update docs Markus Gerstel 3 years ago
6 changed file(s) with 49 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
11 Credits
22 =======
33
4 Development Lead
5 ----------------
6
7 * Markus Gerstel <scientificsoftware@diamond.ac.uk>
4 * Markus Gerstel
85
96 Contributors
107 ------------
00 =======
11 History
22 =======
3
4 0.3.0
5 -----
6
7 * run_process() renamed to run()
8
9 0.2.0 (2018-03-12)
10 ------------------
11
12 * Procrunner is now Python3 3.3-3.6 compatible.
313
414 0.1.0 (2018-03-12)
515 ------------------
2929 Features
3030 --------
3131
32 * TODO
32 * runs an external process and waits for it to finish
33 * does not deadlock, no matter the process stdout/stderr output behaviour
34 * returns the exit code, stdout, stderr (separately), and the total process
35 runtime as a dictionary
36 * process can run in a custom environment, either as a modification of
37 the current environment or in a new environment from scratch
38 * stdin can be fed to the process, the returned dictionary contains
39 information how much was read by the process
40 * stdout and stderr is printed by default, can be disabled
41 * stdout and stderr can be passed to any arbitrary function for
42 live processing
43 * optionally enforces a time limit on the process
3344
3445 Credits
3546 -------
0 ===
1 API
2 ===
3
4 .. automodule:: procrunner
5 :members:
6 :show-inheritance:
7
77 readme
88 installation
99 usage
10 modules
10 api
1111 contributing
1212 authors
1313 history
1414
1515 Indices and tables
1616 ==================
17 * :ref:`genindex`
18 * :ref:`modindex`
1917 * :ref:`search`
44 To use ProcRunner in a project::
55
66 import procrunner
7 result = procrunner.run(['/bin/ls', '/some/path/containing spaces'])
8
9 To test for successful completion::
10
11 assert result['exitcode'] == 0
12
13 To test for no STDERR output::
14
15 assert result['stderr'] == ''
16
17 To run with a specific environment variable set::
18
19 result = procrunner.run(..., environment_override={ 'VARIABLE': 'value' })
20
21 To run with a specific environment::
22
23 result = procrunner.run(..., environment={ 'VARIABLE': 'value' })