/usr/lib/python3/dist-packages/plainbox/vendor/textland/abc.py is in python3-plainbox 0.25-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | # This file is part of textland.
#
# Copyright 2014 Canonical Ltd.
# Written by:
# Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
#
# Textland is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3,
# as published by the Free Software Foundation.
#
# Textland is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Textland. If not, see <http://www.gnu.org/licenses/>.
from abc import abstractmethod, ABCMeta
from .bits import Size
from .events import Event
from .image import TextImage
class IApplication(metaclass=ABCMeta):
"""
Interface for all applications.
Applications are simple objects that react to events by repainting
their buffer. Each application has exactly one full-screen buffer.
"""
@abstractmethod
def consume_event(self, event: Event) -> TextImage:
"""
Send an event to the controller.
:param event:
Event that the controller should handle
This method is called whenever the application should react to an
event. The application may raise StopIteration to ask the display to
exit.
"""
# TODO: this is mis-named, rename it
class IDisplay(metaclass=ABCMeta):
"""
Abstract display system.
"""
@abstractmethod
def run(self, app: IApplication) -> None:
"""
Run forever, feeding events to the controller
the controller can raise StopIteration to "quit"
"""
class IView(metaclass=ABCMeta):
"""
Work-in-progress on views that applications can use
"""
@abstractmethod
def render(self, size: Size) -> TextImage:
"""
Render this view to a new image of the specified size
"""
|