(aid: int)
| 17625 | sys.stdout.flush() |
| 17626 | except Exception: |
| 17627 | pass |
| 17628 | |
| 17629 | def approval_worker(): |
| 17630 | """Deprecated: kept for compatibility. Use approval_prompt() in main thread.""" |
| 17631 | while True: |
| 17632 | username = PENDING_QUEUE.get() |
| 17633 | approval_prompt(username) |
| 17634 | |
| 17635 | # --------------------------- |
| 17636 | # Links: cloudflared + tor (best-effort) |
| 17637 | # --------------------------- |
| 17638 | |
| 17639 | def have_cmd(cmd: str) -> bool: |
| 17640 | """have_cmd. |
| 17641 | |
| 17642 | Internal helper function. |
| 17643 | |
| 17644 | This docstring was added automatically to improve maintainability. |
| 17645 | |
| 17646 | Args: |
| 17647 | cmd: Parameter. |
| 17648 | |
| 17649 | Returns: |
| 17650 | Varies. |
| 17651 | """ |
| 17652 | res = _run(["bash", "-lc", f"command -v {cmd} >/dev/null 2>&1"], check=False) |
| 17653 | return bool(res and res.returncode == 0) |
nothing calls this directly
no test coverage detected