(self)
Set up the console.
Set up the console.
Set up the console .
def __init__(self):
        """Set up the console."""
        # buffer to save termios state
        if not sys.stdin.isatty() or not sys.stdout.isatty():
            raise EnvironmentError('Not a terminal')
        self._term_attr = termios.tcgetattr(sys.stdin.fileno())
        # preserve original terminal size
        self._orig_size = self.get_size()
        self._height, _ = self._orig_size
        # input buffer
        self._read_buffer = deque()
        # palette
        self._palette = list(DEFAULT_PALETTE)
        # needed to access curses.tiget* functions
        if curses:
            curses.setupterm()
        self._muffle = None
def __init__ ( self ) : # buffer to save termios state if not sys . stdin . isatty ( ) or not sys . stdout . isatty ( ) : raise EnvironmentError ( 'Not a terminal' ) self . _term_attr = termios . tcgetattr ( sys . stdin . fileno ( ) ) # preserve original terminal size self . _orig_size = self . get_size ( ) self . _height , _ = self . _orig_size # input buffer self . _read_buffer = deque ( ) # palette self . _palette = list ( DEFAULT_PALETTE ) # needed to access curses.tiget* functions if curses : curses . setupterm ( ) self . _muffle = None