(self, block, column, bracket)
Search for a needle and return (block, column)
        Raise ValueError, if not found
Search for a needle and return (block, column)
        Raise ValueError, if not found
Search for a needle and return ( block column ) Raise ValueError if not found
def findBracketBackward(self, block, column, bracket):
        """Search for a needle and return (block, column)
        Raise ValueError, if not found
        """
        if bracket in ('(', ')'):
            opening = '('
            closing = ')'
        elif bracket in ('[', ']'):
            opening = '['
            closing = ']'
        elif bracket in ('{', '}'):
            opening = '{'
            closing = '}'
        else:
            raise AssertionError('Invalid bracket "%s"' % bracket)

        depth = 1
        for foundBlock, foundColumn, char in self.iterateCharsBackwardFrom(block, column):
            if not self._qpart.isComment(foundBlock.blockNumber(), foundColumn):
                if char == opening:
                    depth = depth - 1
                elif char == closing:
                    depth = depth + 1

                if depth == 0:
                    return foundBlock, foundColumn
        raise ValueError('Not found')
def findBracketBackward ( self , block , column , bracket ) : if bracket in ( '(' , ')' ) : opening = '(' closing = ')' elif bracket in ( '[' , ']' ) : opening = '[' closing = ']' elif bracket in ( '{' , '}' ) : opening = '{' closing = '}' else : raise AssertionError ( 'Invalid bracket "%s"' % bracket ) depth = 1 for foundBlock , foundColumn , char in self . iterateCharsBackwardFrom ( block , column ) : if not self . _qpart . isComment ( foundBlock . blockNumber ( ) , foundColumn ) : if char == opening : depth = depth - 1 elif char == closing : depth = depth + 1 if depth == 0 : return foundBlock , foundColumn raise ValueError ( 'Not found' )