File: callbacks.py

package info (click to toggle)
prompt-toolkit 1.0.9-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 1,452 kB
  • sloc: python: 15,352; makefile: 3
file content (29 lines) | stat: -rw-r--r-- 735 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from __future__ import unicode_literals
from abc import ABCMeta, abstractmethod
from six import with_metaclass

__all__ = (
    'EventLoopCallbacks',
)


class EventLoopCallbacks(with_metaclass(ABCMeta, object)):
    """
    This is the glue between the :class:`~prompt_toolkit.eventloop.base.EventLoop`
    and :class:`~prompt_toolkit.interface.CommandLineInterface`.

    :meth:`~prompt_toolkit.eventloop.base.EventLoop.run` takes an
    :class:`.EventLoopCallbacks` instance and operates on that one, driving the
    interface.
    """
    @abstractmethod
    def terminal_size_changed(self):
        pass

    @abstractmethod
    def input_timeout(self):
        pass

    @abstractmethod
    def feed_key(self, key):
        pass