def _run_tty(self, writer, reader):
        """Pager run method for terminals that are a tty."""
        # allow window-change signal to reflow screen
        signal.signal(signal.SIGWINCH, self.on_resize)

        page_idx = page_offset = 0
        while True:
            if self.dirty:
                page_idx, page_offset = self.draw(writer,
                                                  page_idx,
                                                  page_offset)
                self.dirty = self.STATE_CLEAN
            inp = reader(timeout=0.25)
            if inp is not None:
                nxt, noff = self.process_keystroke(inp,
                                                   page_idx,
                                                   page_offset)
            if not self.dirty:
                self.dirty = nxt != page_idx or noff != page_offset
            page_idx, page_offset = nxt, noff
            if page_idx == -1:
                return
def _run_tty ( self , writer , reader ) : signal . signal ( signal . SIGWINCH , self . on_resize ) page_idx = page_offset = 0 while True : if self . dirty : page_idx , page_offset = self . draw ( writer , page_idx , page_offset ) self . dirty = self . STATE_CLEAN inp = reader ( timeout = 0.25 ) if inp is not None : nxt , noff = self . process_keystroke ( inp , page_idx , page_offset ) if not self . dirty : self . dirty = nxt != page_idx or noff != page_offset page_idx , page_offset = nxt , noff if page_idx == - 1 : return
Pager run method for terminals that are a tty.