def _screenshot_logic(self):
        # take screenshot
        pyglet.image.get_buffer_manager().get_color_buffer().save(self.template % self.frameno)
        self.frameno += 1

        # end?
        if self.duration:
            if self.fake_time > self.duration:
                raise SystemExit()
takes screenshots, handles end of screenshot session
dataset/ETHPy150Open los-cocos/cocos/cocos/custom_clocks.py/ScreenReaderClock._screenshot_logic