| 270 | # since this could be a shared bar which the user will `reset()` |
| 271 | |
| 272 | def close(self): |
| 273 | if self.disable: |
| 274 | return |
| 275 | super().close() |
| 276 | # Try to detect if there was an error or KeyboardInterrupt |
| 277 | # in manual mode: if n < total, things probably got wrong |
| 278 | if self.total and self.n < self.total: |
| 279 | self.disp(bar_style='danger', check_delay=False) |
| 280 | else: |
| 281 | if self.leave: |
| 282 | self.disp(bar_style='success', check_delay=False) |
| 283 | else: |
| 284 | self.disp(close=True, check_delay=False) |
| 285 | |
| 286 | def clear(self, *_, **__): |
| 287 | pass |