test-kivy-app/kivy_venv/lib/python3.11/site-packages/asynckivy/_exceptions.py
2024-09-15 20:57:02 +03:00

28 lines
764 B
Python

__all__ = (
'MotionEventAlreadyEndedError',
)
class MotionEventAlreadyEndedError(Exception):
'''
This error occurs when an already-ended touch is passed to an asynckivy API that expects an ongoing touch.
For instance:
.. code-block::
:emphasize-lines: 4
import asynckivy as ak
class MyWidget(Widget):
def on_touch_up(self, touch): # not 'on_touch_down', oops!
ak.start(self.handle_touch(touch))
return True
async def handle_touch(self, touch):
try:
async for __ in ak.rest_of_touch_events(widget, touch):
...
except ak.MotionEventAlreadyEndedError:
...
'''