MCPcopy Create free account
hub / github.com/HypothesisWorks/hypothesis / print_command

Function print_command

tooling/src/hypothesistooling/scripts.py:20–35  ·  view source on GitHub ↗
(command, args)

Source from the content-addressed store, hash-verified

18
19
20def print_command(command, args):
21 args = list(args)
22 ranges = []
23 for i, v in enumerate(args):
24 if os.path.exists(v):
25 if not ranges or ranges[-1][-1] < i - 1:
26 ranges.append([i, i])
27 elif ranges[-1][-1] + 1 == i:
28 ranges[-1][-1] += 1
29 for i, j in ranges:
30 if j > i:
31 args[i] = "..."
32 for k in range(i + 1, j + 1):
33 args[k] = None
34 args = [v for v in args if v is not None]
35 print(command, *map(shlex.quote, args))
36
37
38def run_script(script, *args, **kwargs):

Callers 2

run_scriptFunction · 0.85
pip_toolFunction · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected