Call the reckless executable, optionally with a directory.
(cmds: list, dir: PosixPath = None,
autoconfirm=True, timeout: int = 60)
| 128 | |
| 129 | |
| 130 | def reckless(cmds: list, dir: PosixPath = None, |
| 131 | autoconfirm=True, timeout: int = 60): |
| 132 | '''Call the reckless executable, optionally with a directory.''' |
| 133 | if dir is not None: |
| 134 | cmds.insert(0, "-l") |
| 135 | cmds.insert(1, str(dir)) |
| 136 | cmds.insert(0, "tools/reckless") |
| 137 | if autoconfirm: |
| 138 | process_input = 'Y\n' |
| 139 | else: |
| 140 | process_input = None |
| 141 | r = subprocess.run(cmds, capture_output=True, encoding='utf-8', env=my_env, |
| 142 | input=process_input, timeout=timeout) |
| 143 | stdout = r.stdout.splitlines() |
| 144 | stderr = r.stderr.splitlines() |
| 145 | print(" ".join(r.args), "\n") |
| 146 | print("***RECKLESS STDOUT***") |
| 147 | for l in stdout: |
| 148 | print(l) |
| 149 | print('\n') |
| 150 | print("***RECKLESS STDERR***") |
| 151 | for l in stderr: |
| 152 | print(l) |
| 153 | print('\n') |
| 154 | return RecklessResult(r, r.returncode, stdout, stderr) |
| 155 | |
| 156 | |
| 157 | def get_reckless_node(node_factory): |
no test coverage detected