| 79 | |
| 80 | |
| 81 | class NeedsTracker: |
| 82 | def __init__(self): |
| 83 | self._needs = [] |
| 84 | |
| 85 | def append(self, need): |
| 86 | if need not in self._needs: |
| 87 | self._needs.append(need) |
| 88 | |
| 89 | def iter(self, consume=False): |
| 90 | if consume is False: |
| 91 | for need in self._needs: |
| 92 | yield need |
| 93 | return |
| 94 | while self._needs: |
| 95 | need = self._needs.pop(0) |
| 96 | yield need |
| 97 | |
| 98 | def __bool__(self): |
| 99 | return bool(self._needs) |
| 100 | |
| 101 | |
| 102 | @cgroup.command( |
no outgoing calls
no test coverage detected