(self, f)
| 36 | self.listify = listify |
| 37 | |
| 38 | def __call__(self, f): |
| 39 | def strip_it(x): |
| 40 | return x.strip() if self.strip else x |
| 41 | |
| 42 | def list_it(x): |
| 43 | return x.decode('utf-8').splitlines() if self.listify else x |
| 44 | |
| 45 | def wrapper(*argv, **kwargs): |
| 46 | # Ensure stdout is captured |
| 47 | kwargs["stdout"] = subprocess.PIPE |
| 48 | return list_it(strip_it(f(*argv, **kwargs).stdout)) |
| 49 | return wrapper |
| 50 | |
| 51 | |
| 52 | class Command: |
nothing calls this directly
no outgoing calls
no test coverage detected