(self)
| 300 | time.sleep(0.08) |
| 301 | |
| 302 | def start(self): |
| 303 | # Spin only on a real console; in a redirected/captured stream the |
| 304 | # frames cannot animate and would pile up as '\r' noise in the data. |
| 305 | try: |
| 306 | if not sys.stderr.isatty(): |
| 307 | return |
| 308 | except Exception: |
| 309 | return |
| 310 | self.running = True |
| 311 | self.thread = threading.Thread(target=self._animate, daemon=True) |
| 312 | self.thread.start() |
| 313 | |
| 314 | def stop(self): |
| 315 | self.running = False |
no outgoing calls