def draw_status(self, writer, idx):
        """
        Conditionally draw status bar when output terminal is a tty.

        :param writer: callable writes to output stream, receiving unicode.
        :param idx: current page position index.
        :type idx: int
        """
        if self.term.is_a_tty:
            writer(self.term.hide_cursor())
            style = self.screen.style
            writer(self.term.move(self.term.height - 1))
            if idx == self.last_page:
                last_end = u'(END)'
            else:
                last_end = u'/{0}'.format(self.last_page)
            txt = (u'Page {idx}{last_end} - '
                   u'{q} to quit, [keys: {keyset}]'
                   .format(idx=style.attr_minor(u'{0}'.format(idx)),
                           last_end=style.attr_major(last_end),
                           keyset=style.attr_major('kjfb12-='),
                           q=style.attr_minor(u'q')))
            writer(self.term.center(txt).rstrip())
def draw_status ( self , writer , idx ) : if self . term . is_a_tty : writer ( self . term . hide_cursor ( ) ) style = self . screen . style writer ( self . term . move ( self . term . height - 1 ) ) if idx == self . last_page : last_end = u'(END)' else : last_end = u'/{0}' . format ( self . last_page ) txt = ( u'Page {idx}{last_end} - ' u'{q} to quit, [keys: {keyset}]' . format ( idx = style . attr_minor ( u'{0}' . format ( idx ) ) , last_end = style . attr_major ( last_end ) , keyset = style . attr_major ( 'kjfb12-=' ) , q = style . attr_minor ( u'q' ) ) ) writer ( self . term . center ( txt ) . rstrip ( ) )
Conditionally draw status bar when output terminal is a tty.

        :param writer: callable writes to output stream, receiving unicode.
        :param idx: current page position index.
        :type idx: int