(message: str)
| 131 | |
| 132 | |
| 133 | def delayed_warning(message: str) -> bool: |
| 134 | # Issue a final warning before we continue with something un-revertable. |
| 135 | # We count down from 5 to 0. |
| 136 | print(message, end='', flush=True) |
| 137 | |
| 138 | try: |
| 139 | countdown = '\n5...4...3...2...1\n' |
| 140 | for c in countdown: |
| 141 | print(c, end='', flush=True) |
| 142 | time.sleep(0.25) |
| 143 | except KeyboardInterrupt: |
| 144 | ret: bool = tui.run(confirm_abort) |
| 145 | if ret: |
| 146 | sys.exit(1) |
| 147 | |
| 148 | return True |