callbacks.py 735 B

1234567891011121314151617181920212223242526272829
  1. from __future__ import unicode_literals
  2. from abc import ABCMeta, abstractmethod
  3. from six import with_metaclass
  4. __all__ = (
  5. 'EventLoopCallbacks',
  6. )
  7. class EventLoopCallbacks(with_metaclass(ABCMeta, object)):
  8. """
  9. This is the glue between the :class:`~prompt_toolkit.eventloop.base.EventLoop`
  10. and :class:`~prompt_toolkit.interface.CommandLineInterface`.
  11. :meth:`~prompt_toolkit.eventloop.base.EventLoop.run` takes an
  12. :class:`.EventLoopCallbacks` instance and operates on that one, driving the
  13. interface.
  14. """
  15. @abstractmethod
  16. def terminal_size_changed(self):
  17. pass
  18. @abstractmethod
  19. def input_timeout(self):
  20. pass
  21. @abstractmethod
  22. def feed_key(self, key):
  23. pass