コード例 #1
0
ファイル: tui.py プロジェクト: rhinstaller/initial-setup
from initial_setup.product import get_product_title, is_final
from initial_setup.common import list_usable_consoles_for_tui, get_quit_message
from .hubs import InitialSetupMainHub

from simpleline import App
from simpleline.errors import NothingScheduledError

import os
import sys
import select
import contextlib
import termios
import logging
log = logging.getLogger("initial-setup")

QUIT_MESSAGE = get_quit_message()


class MultipleTTYHandler(object):
    """Run the Initial Setup TUI on all usable consoles.

    This is done by redirecting the Initial Setup stdout to all
    usable consoles and then redirecting any input back to
    the Initial Setup stdin.
    """

    def __init__(self, tui_stdout_fd, tui_stdin_fd):
        # create file objects for the TUI stdout and stdin fds
        self._tui_stdout_fd = tui_stdout_fd
        self._tui_stdout = os.fdopen(tui_stdout_fd, "r")
        self._tui_stdin_fd = tui_stdin_fd
コード例 #2
0
class InitialSetupQuitDialog(QuitDialog):
    MESSAGE = get_quit_message()