Skip to content

Commit

Permalink
rename 'eats_touch' to 'eat_touch'
Browse files Browse the repository at this point in the history
  • Loading branch information
gottadiveintopython committed Jul 23, 2020
1 parent 6b7660b commit f1b27ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions asynckivy/_rest_of_touch_moves.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
import types


async def rest_of_touch_moves(widget, touch, *, eats_touch=False):
async def rest_of_touch_moves(widget, touch, *, eat_touch=False):
'''Returns an async-generator, which yields the touch when `on_touch_move`
is fired, and ends when `on_touch_up` is fired. Grabs and ungrabs the
touch automatically. If `eats_touch` is True, the touch will never be
touch automatically. If `eat_touch` is True, the touch will never be
dispatched further.
'''
from asynckivy._core import _get_step_coro
step_coro = await _get_step_coro()

if eats_touch:
if eat_touch:
def _on_touch_up(w, t):
if t is touch:
if t.grab_current is w:
Expand Down
6 changes: 3 additions & 3 deletions tests/test_rest_of_touch_moves.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,17 @@ async def _test(w, t):


@pytest.mark.parametrize(
'eats_touch, expectation', [
'eat_touch, expectation', [
(True, [0, 0, 0, ], ),
(False, [1, 2, 1, ], ),
])
def test_eat_touch_events(touch_cls, eats_touch, expectation):
def test_eat_touch_events(touch_cls, eat_touch, expectation):
from kivy.uix.widget import Widget
import asynckivy as ak

async def _test(parent, t):
async for __ in ak.rest_of_touch_moves(
parent, t, eats_touch=eats_touch):
parent, t, eat_touch=eat_touch):
pass
nonlocal done;done = True

Expand Down

0 comments on commit f1b27ea

Please sign in to comment.