Beispiel #1
0
    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()))
Beispiel #2
0
    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()))
Beispiel #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]
Beispiel #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]
Beispiel #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
Beispiel #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