(self, query)
Search the awesome content with given query

        Args:
            query: Query string

        Returns:
            None
Search the awesome content with given query
Search the awesome content with given query
def search(self, query):
        """Search the awesome content with given query

        Args:
            query: Query string

        Returns:
            None
        """
        matched_blocks = []
        if query:
            query_tokens = query.lower().split()
            for block in self.awesome_blocks:
                if all([token in block['line'].lower() for token in query_tokens]):
                    matched_blocks.append(block)
        else:
            matched_blocks = self.awesome_blocks

        # Set the bottom to length of matched blocks
        self.bottom = len(matched_blocks)
        self.page = self.bottom // self.max_lines

        # When reached bottom line, stop scrolling
        if self.current > self.bottom:
            self.current = self.bottom - 1
        self.matched_blocks = matched_blocks
def search ( self , query ) : matched_blocks = [ ] if query : query_tokens = query . lower ( ) . split ( ) for block in self . awesome_blocks : if all ( [ token in block [ 'line' ] . lower ( ) for token in query_tokens ] ) : matched_blocks . append ( block ) else : matched_blocks = self . awesome_blocks # Set the bottom to length of matched blocks self . bottom = len ( matched_blocks ) self . page = self . bottom // self . max_lines # When reached bottom line, stop scrolling if self . current > self . bottom : self . current = self . bottom - 1 self . matched_blocks = matched_blocks