(self, direction)
Paging the result window when pressing left/right arrow keys

        Args:
            direction: Up or Down

        Returns:
            None
Paging the result window when pressing left/right arrow keys
Paging the result window when pressing left / right arrow keys
def paging(self, direction):
        """Paging the result window when pressing left/right arrow keys

        Args:
            direction: Up or Down

        Returns:
            None
        """
        current_page = (self.top + self.current) // self.max_lines
        next_page = current_page + direction
        # The last page may have fewer items than max lines,
        # so we should adjust the current cursor position as maximum item count on last page
        if next_page == self.page:
            self.current = min(self.current, self.bottom % self.max_lines - 1)

        # Page up
        if (direction == self.UP) and (current_page > 0):
            self.top = max(0, self.top - self.max_lines)
            return
        # Page down
        if (direction == self.DOWN) and (current_page < self.page):
            self.top += self.max_lines
            return
def paging ( self , direction ) : current_page = ( self . top + self . current ) // self . max_lines next_page = current_page + direction # The last page may have fewer items than max lines, # so we should adjust the current cursor position as maximum item count on last page if next_page == self . page : self . current = min ( self . current , self . bottom % self . max_lines - 1 ) # Page up if ( direction == self . UP ) and ( current_page > 0 ) : self . top = max ( 0 , self . top - self . max_lines ) return # Page down if ( direction == self . DOWN ) and ( current_page < self . page ) : self . top += self . max_lines return