Exemplo n.º 1
0
def stripper(docstring):
    """Slightly smarter :func:`dedent <python:textwrap.dedent>`

    It strips a docstring's first line indentation and dedents the rest

    """
    if docstring:
        lines = docstring.splitlines()
        return os.linesep.join(
            [lines[0].strip(), dedent("\n".join(lines[1:]))])
    else:  # If docstring is a null string, GoogleDocstring will expect an iterable type
        return ''
Exemplo n.º 2
0
def stripper(docstring):
    """Slightly smarter :func:`dedent <python:textwrap.dedent>`

    It strips a docstring's first line indentation and dedents the rest

    """
    if docstring:
        lines = docstring.splitlines()
        return os.linesep.join([
            lines[0].strip(), dedent("\n".join(lines[1:]))
        ])
    else:  # If docstring is a null string, GoogleDocstring will expect an iterable type
        return ''