Codebase list python-procrunner / c9cfc40
Update comments Markus Gerstel 2 years ago
1 changed file(s) with 15 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
1717 #
1818 # - runs an external process and waits for it to finish
1919 # - does not deadlock, no matter the process stdout/stderr output behaviour
20 # - returns the exit code, stdout, stderr (separately), and the total process
21 # runtime as a dictionary
20 # - returns the exit code, stdout, stderr (separately) as a
21 # subprocess.CompletedProcess object
2222 # - process can run in a custom environment, either as a modification of
2323 # the current environment or in a new environment from scratch
2424 # - stdin can be fed to the process, the returned dictionary contains
3636 #
3737 # Returns:
3838 #
39 # {'command': ['/bin/ls', '/some/path/containing spaces'],
40 # 'exitcode': 2,
41 # 'runtime': 0.12990689277648926,
42 # 'stderr': '/bin/ls: cannot access /some/path/containing spaces: No such file or directory\n',
43 # 'stdout': '',
44 # 'time_end': '2017-11-12 19:54:49 GMT',
45 # 'time_start': '2017-11-12 19:54:49 GMT',
46 # 'timeout': False}
47 #
39 # ReturnObject(
40 # args=('/bin/ls', '/some/path/containing spaces'),
41 # returncode=2,
42 # stdout=b'',
43 # stderr=b'/bin/ls: cannot access /some/path/containing spaces: No such file or directory\n'
44 # )
45 #
46 # which also offers (albeit deprecated)
47 #
48 # result.runtime == 0.12990689277648926
49 # result.time_end == '2017-11-12 19:54:49 GMT'
50 # result.time_start == '2017-11-12 19:54:49 GMT'
51 # result.timeout == False
4852
4953 __author__ = """Markus Gerstel"""
5054 __email__ = "scientificsoftware@diamond.ac.uk"