MCPcopy
hub / github.com/pytest-dev/pytest / __call__

Method __call__

testing/test_argcomplete.py:50–69  ·  view source on GitHub ↗
(self, prefix, **kwargs)

Source from the content-addressed store, hash-verified

48 self.directories = directories
49
50 def __call__(self, prefix, **kwargs):
51 completion = []
52 if self.allowednames:
53 if self.directories:
54 files = _wrapcall(["bash", "-c", f"compgen -A directory -- '{prefix}'"])
55 completion += [f + "/" for f in files]
56 for x in self.allowednames:
57 completion += _wrapcall(
58 ["bash", "-c", f"compgen -A file -X '!*.{x}' -- '{prefix}'"]
59 )
60 else:
61 completion += _wrapcall(["bash", "-c", f"compgen -A file -- '{prefix}'"])
62
63 anticomp = _wrapcall(["bash", "-c", f"compgen -A directory -- '{prefix}'"])
64
65 completion = list(set(completion) - set(anticomp))
66
67 if self.directories:
68 completion += [f + "/" for f in anticomp]
69 return completion
70
71
72class TestArgComplete:

Callers

nothing calls this directly

Calls 1

_wrapcallFunction · 0.85

Tested by

no test coverage detected