INNER CODE UNIT · Python

remove_before

wwood/singlem · admin/build_docs.py:10

def remove_before(marker, string_to_process):
    splitter = '\n# ' + marker + '\n'
    if splitter not in string_to_process:
        raise Exception("Marker '{}' not found in string".format(marker))
    return splitter + string_to_process.split(splitter)[1]


def get_version(relpath):
    """Read version info from a file without importing it"""
    for line in io.open(join(dirname(__file__), '..', relpath), encoding="cp437"):
        if "__version__" in line:
            if '"' in line:
                return line.split('"')[1]
            elif "'" in line:
                return line.split("'")[1]


if __name__ == '__main__':

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…