Update comments
Markus Gerstel
2 years ago
17 | 17 | # |
18 | 18 | # - runs an external process and waits for it to finish |
19 | 19 | # - 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 | |
22 | 22 | # - process can run in a custom environment, either as a modification of |
23 | 23 | # the current environment or in a new environment from scratch |
24 | 24 | # - stdin can be fed to the process, the returned dictionary contains |
36 | 36 | # |
37 | 37 | # Returns: |
38 | 38 | # |
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 | |
48 | 52 | |
49 | 53 | __author__ = """Markus Gerstel""" |
50 | 54 | __email__ = "scientificsoftware@diamond.ac.uk" |