(s, versions)
return "\n".join(new_lines)
s is a string representation of a file.
s is a string representation of a file.
s is a string representation of a file .
def _process_file(s, versions):
    """s is a string representation of a file."""
    new_lines = []
    do_add = True
    lines = s.split("\n")
    for ind, line in enumerate(lines):
        if line.strip() == start_tag:
            new_lines.append(line)
            do_add = False
            url_root = url_root_from_line(lines[ind+1])
            new_lines.append(lines[ind+1])
            versions_ = [url_root + '../' + v for v in versions]
            new_lines.append(reduce(add,
                                    map(version_entry_generator,
                                        versions_, versions)))
        elif do_add:
            new_lines.append(line)
        elif line.strip() == end_tag:
            new_lines.append(line)
            do_add = True
        else:
            continue
    return "\n".join(new_lines)
def _process_file ( s , versions ) : new_lines = [ ] do_add = True lines = s . split ( "\n" ) for ind , line in enumerate ( lines ) : if line . strip ( ) == start_tag : new_lines . append ( line ) do_add = False url_root = url_root_from_line ( lines [ ind + 1 ] ) new_lines . append ( lines [ ind + 1 ] ) versions_ = [ url_root + '../' + v for v in versions ] new_lines . append ( reduce ( add , map ( version_entry_generator , versions_ , versions ) ) ) elif do_add : new_lines . append ( line ) elif line . strip ( ) == end_tag : new_lines . append ( line ) do_add = True else : continue return "\n" . join ( new_lines )