Handler for getting events.
(self, *args)
| 1456 | super().__init__(fig, event_source=event_source, *args, **kwargs) |
| 1457 | |
| 1458 | def _step(self, *args): |
| 1459 | """Handler for getting events.""" |
| 1460 | # Extends the _step() method for the Animation class. If |
| 1461 | # Animation._step signals that it reached the end and we want to |
| 1462 | # repeat, we refresh the frame sequence and return True. If |
| 1463 | # _repeat_delay is set, change the event_source's interval to our loop |
| 1464 | # delay and set the callback to one which will then set the interval |
| 1465 | # back. |
| 1466 | still_going = super()._step(*args) |
| 1467 | if not still_going: |
| 1468 | if self._repeat: |
| 1469 | # Restart the draw loop |
| 1470 | self._init_draw() |
| 1471 | self.frame_seq = self.new_frame_seq() |
| 1472 | self.event_source.interval = self._repeat_delay |
| 1473 | return True |
| 1474 | else: |
| 1475 | # We are done with the animation. Call pause to remove |
| 1476 | # animated flags from artists that were using blitting |
| 1477 | self.pause() |
| 1478 | if self._blit: |
| 1479 | # Remove the resize callback if we were blitting |
| 1480 | self._fig.canvas.mpl_disconnect(self._resize_id) |
| 1481 | self._fig.canvas.mpl_disconnect(self._close_id) |
| 1482 | self.event_source = None |
| 1483 | return False |
| 1484 | |
| 1485 | self.event_source.interval = self._interval |
| 1486 | return True |
| 1487 | |
| 1488 | |
| 1489 | class ArtistAnimation(TimedAnimation): |
nothing calls this directly
no test coverage detected