Exemplo n.º 1
0
Arquivo: pager.py Projeto: gofore/x84
    def read(self):
        """
        Blocking read-eval-print loop for pager.

        Processes user input, taking action upon and refreshing pager
        until the escape key is pressed.

        :rtype: None
        """
        self._quit = False
        echo(self.refresh())
        while not self.quit:
            echo(self.process_keystroke(getch()))
Exemplo n.º 2
0
Arquivo: pager.py Projeto: splaice/x84
    def read(self):
        """
        Blocking read-eval-print loop for pager.

        Processes user input, taking action upon and refreshing pager
        until the escape key is pressed.

        :rtype: None
        """
        self._quit = False
        echo(self.refresh())
        while not self.quit:
            echo(self.process_keystroke(getch()))
Exemplo n.º 3
0
    def read(self):
        """
        Reads input until the ENTER or ESCAPE key is pressed (Blocking).

        Returns selection content, or None when canceled.
        """
        self._selected = False
        self._quit = False
        echo(self.refresh())
        while not (self.selected or self.quit):
            echo(self.process_keystroke(getch()))
        if self.quit:
            return None
        return self.selection[0]
Exemplo n.º 4
0
    def read(self):
        """
        Reads input until the ENTER or ESCAPE key is pressed (Blocking).

        Returns selection content, or None when canceled.
        """
        self._selected = False
        self._quit = False
        echo(self.refresh())
        while not (self.selected or self.quit):
            echo(self.process_keystroke(getch()))
        if self.quit:
            return None
        return self.selection[0]
Exemplo n.º 5
0
    def read(self):
        """
        Reads input until the ENTER or ESCAPE key is pressed (Blocking).

        Allows backspacing. Returns unicode text, or None when canceled.
        """
        echo(self.refresh())
        self._quit = False
        self._carriage_returned = False
        while not (self.quit or self.carriage_returned):
            inp = getch()
            echo(self.process_keystroke(inp))
        if not self.quit:
            return self.content
        return None
Exemplo n.º 6
0
    def read(self):
        """
        Reads input until the ENTER or ESCAPE key is pressed (Blocking).

        Allows backspacing. Returns unicode text, or None when canceled.
        """
        echo(self.refresh())
        self._quit = False
        self._carriage_returned = False
        while not (self.quit or self.carriage_returned):
            inp = getch()
            echo(self.process_keystroke(inp))
        if not self.quit:
            return self.content
        return None