cuda_cffi/_cffi_autogen_common.py
def split_line(line, break_pattern=', ', nmax=80, pad_char='('):
    """ split a line (repeatedly) until length < nmax chars.

    split will occur at last occurence of break_pattern occuring before nmax
    characters

    subsequent lines will be indented until the first occurance of pad_char
    in the initial line

    Parameters
    ----------
    line : str
        line to reformat
    break_pattern : str, optional
        break line only where this pattern occurs
    nmax : int, optional
        max number of characters to allow
    pad_char : str, optional
        auto-indent subsequent lines up to the first occurance of pad_char

    Returns
    -------
    new_line : str
        reformatted line
    """
    if len(line) < nmax:
        return line.rstrip() + '\n'
    locs, break_loc = _find_breakpoint(line,
                                       break_pattern=break_pattern,
                                       nmax=nmax)
    if break_loc is None:
        return line.rstrip() + '\n'
    if pad_char is not None:
        npad = line.find(pad_char) + 1
    else:
        npad = 0

    lines = []
    lines.append(line[:break_loc].rstrip())
    line = ' ' * npad + line[break_loc:]
    while (len(line) > nmax - 1) and (break_loc is not None) and break_pattern in line:
        locs, break_loc = _find_breakpoint(line,
                                           break_pattern=break_pattern,
                                           nmax=nmax)
        lines.append(line[:break_loc].rstrip())
        line = ' ' * npad + line[break_loc:]
    lines.append(line.rstrip())
    return '\n'.join(lines) + '\n'
 split a line (repeatedly) until length < nmax chars.

    split will occur at last occurence of break_pattern occuring before nmax
    characters

    subsequent lines will be indented until the first occurance of pad_char
    in the initial line

    Parameters
    ----------
    line : str
        line to reformat
    break_pattern : str, optional
        break line only where this pattern occurs
    nmax : int, optional
        max number of characters to allow
    pad_char : str, optional
        auto-indent subsequent lines up to the first occurance of pad_char

    Returns
    -------
    new_line : str
        reformatted line
    
split a line (repeatedly) until length < nmax chars.
split will occur at last occurence of break_pattern occuring before nmax
characters

subsequent lines will be indented until the first occurance of pad_char
in the initial line

Parameters

line : str
line to reformat
break_pattern : str, optional
break line only where this pattern occurs
nmax : int, optional
max number of characters to allow
pad_char : str, optional
auto-indent subsequent lines up to the first occurance of pad_char

Returns

new_line : str
reformatted line
split a line ( repeatedly ) until length < nmax chars . split will occur at last occurence of break_pattern occuring before nmax characters subsequent lines will be indented until the first occurance of pad_char in the initial line Parameters line : str line to reformat break_pattern : str optional break line only where this pattern occurs nmax : int optional max number of characters to allow pad_char : str optional auto - indent subsequent lines up to the first occurance of pad_char Returns new_line : str reformatted line
def split_line(line, break_pattern=', ', nmax=80, pad_char='('):
    if len(line) < nmax:
        return line.rstrip() + '\n'
    locs, break_loc = _find_breakpoint(line,
                                       break_pattern=break_pattern,
                                       nmax=nmax)
    if break_loc is None:
        return line.rstrip() + '\n'
    if pad_char is not None:
        npad = line.find(pad_char) + 1
    else:
        npad = 0
    lines = []
    lines.append(line[:break_loc].rstrip())
    line = ' ' * npad + line[break_loc:]
    while (len(line) > nmax - 1) and (break_loc is not None) and break_pattern in line:
        locs, break_loc = _find_breakpoint(line,
                                           break_pattern=break_pattern,
                                           nmax=nmax)
        lines.append(line[:break_loc].rstrip())
        line = ' ' * npad + line[break_loc:]
    lines.append(line.rstrip())
    return '\n'.join(lines) + '\n'
def split_line ( line , break_pattern = ', ' , nmax = 80 , pad_char = '(' ) : if len ( line ) < nmax : return line . rstrip ( ) + '\n' locs , break_loc = _find_breakpoint ( line , break_pattern = break_pattern , nmax = nmax ) if break_loc is None : return line . rstrip ( ) + '\n' if pad_char is not None : npad = line . find ( pad_char ) + 1 else : npad = 0 lines = [ ] lines . append ( line [ : break_loc ] . rstrip ( ) ) line = ' ' * npad + line [ break_loc : ] while ( len ( line ) > nmax - 1 ) and ( break_loc is not None ) and break_pattern in line : locs , break_loc = _find_breakpoint ( line , break_pattern = break_pattern , nmax = nmax ) lines . append ( line [ : break_loc ] . rstrip ( ) ) line = ' ' * npad + line [ break_loc : ] lines . append ( line . rstrip ( ) ) return '\n' . join ( lines ) + '\n'
split a line (repeatedly) until length < nmax chars.
split a line ( repeatedly ) until length < nmax chars .
""" split a line (repeatedly) until length < nmax chars.

    split will occur at last occurence of break_pattern occuring before nmax
    characters

    subsequent lines will be indented until the first occurance of pad_char
    in the initial line

    Parameters
    ----------
    line : str
        line to reformat
    break_pattern : str, optional
        break line only where this pattern occurs
    nmax : int, optional
        max number of characters to allow
    pad_char : str, optional
        auto-indent subsequent lines up to the first occurance of pad_char

    Returns
    -------
    new_line : str
        reformatted line
    """
line
break_pattern
nmax
pad_char