wpiformat/wpiformat/stdlib.py
def func_substitute(header, lines):
        """Returns modified lines and whether string changed.

        Keyword arguments:
        header -- Header object
        lines -- file contents string

        Returns modified file contents string
        """
        pos = 0
        while pos < len(lines):
            old_length = len(lines)

            # Check for function starting at "pos"
            match = header.func_regex.search(lines, pos)
            if not match:
                break

            # Set "pos" to after current match
            pos = match.start(1) + len(header.prefix) + len(match.group(1))

            # If function name is part of this header, substitute its name
            if match.group(1) in header.func_names:
                lines = lines[0:match.start(1)] + header.prefix + \
                    match.group(1) + lines[match.end(1):]
        return lines
Returns modified lines and whether string changed.

        Keyword arguments:
        header -- Header object
        lines -- file contents string

        Returns modified file contents string
        
Returns modified lines and whether string changed.
Keyword arguments:
header -- Header object
lines -- file contents string

Returns modified file contents string
Returns modified lines and whether string changed . Keyword arguments : header -- Header object lines -- file contents string Returns modified file contents string
def func_substitute(header, lines):
        pos = 0
        while pos < len(lines):
            old_length = len(lines)
            match = header.func_regex.search(lines, pos)
            if not match:
                break
            pos = match.start(1) + len(header.prefix) + len(match.group(1))
            if match.group(1) in header.func_names:
                lines = lines[0:match.start(1)] + header.prefix + \
                    match.group(1) + lines[match.end(1):]
        return lines
def func_substitute ( header , lines ) : pos = 0 while pos < len ( lines ) : old_length = len ( lines ) match = header . func_regex . search ( lines , pos ) if not match : break pos = match . start ( 1 ) + len ( header . prefix ) + len ( match . group ( 1 ) ) if match . group ( 1 ) in header . func_names : lines = lines [ 0 : match . start ( 1 ) ] + header . prefix + match . group ( 1 ) + lines [ match . end ( 1 ) : ] return lines
Returns modified lines and whether string changed.
Returns modified lines and whether string changed .
"""Returns modified lines and whether string changed.

        Keyword arguments:
        header -- Header object
        lines -- file contents string

        Returns modified file contents string
        """ # Check for function starting at "pos" # Set "pos" to after current match # If function name is part of this header, substitute its name
header
lines