diff options
author | Ivan Blinkov <ivan@blinkov.ru> | 2022-02-10 16:47:10 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:10 +0300 |
commit | 1aeb9a455974457866f78722ad98114bafc84e8a (patch) | |
tree | e4340eaf1668684d83a0a58c36947c5def5350ad /contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/mouse_handlers.py | |
parent | bd5ef432f5cfb1e18851381329d94665a4c22470 (diff) | |
download | ydb-1aeb9a455974457866f78722ad98114bafc84e8a.tar.gz |
Restoring authorship annotation for Ivan Blinkov <ivan@blinkov.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/mouse_handlers.py')
-rw-r--r-- | contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/mouse_handlers.py | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/mouse_handlers.py b/contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/mouse_handlers.py index d443bf8315..57e4125b6d 100644 --- a/contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/mouse_handlers.py +++ b/contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/mouse_handlers.py @@ -1,29 +1,29 @@ -from __future__ import unicode_literals - -from itertools import product -from collections import defaultdict - -__all__ = ( - 'MouseHandlers', -) - - -class MouseHandlers(object): - """ - Two dimentional raster of callbacks for mouse events. - """ - def __init__(self): - def dummy_callback(cli, mouse_event): - """ - :param mouse_event: `MouseEvent` instance. - """ - - # Map (x,y) tuples to handlers. - self.mouse_handlers = defaultdict(lambda: dummy_callback) - - def set_mouse_handler_for_range(self, x_min, x_max, y_min, y_max, handler=None): - """ - Set mouse handler for a region. - """ - for x, y in product(range(x_min, x_max), range(y_min, y_max)): - self.mouse_handlers[x,y] = handler +from __future__ import unicode_literals + +from itertools import product +from collections import defaultdict + +__all__ = ( + 'MouseHandlers', +) + + +class MouseHandlers(object): + """ + Two dimentional raster of callbacks for mouse events. + """ + def __init__(self): + def dummy_callback(cli, mouse_event): + """ + :param mouse_event: `MouseEvent` instance. + """ + + # Map (x,y) tuples to handlers. + self.mouse_handlers = defaultdict(lambda: dummy_callback) + + def set_mouse_handler_for_range(self, x_min, x_max, y_min, y_max, handler=None): + """ + Set mouse handler for a region. + """ + for x, y in product(range(x_min, x_max), range(y_min, y_max)): + self.mouse_handlers[x,y] = handler |