def update(self, old_line, new_line, once=False):
nb = <NUM_LIT:0><EOL>for i, line in enumerate(self.lines):<EOL><INDENT>if line.match(old_line):<EOL><INDENT>self.lines[i] = new_line<EOL>nb += <NUM_LIT:1><EOL>if once:<EOL><INDENT>return nb<EOL><DEDENT><DEDENT><DEDENT>return nb<EOL>
Replace all lines matching `old_line` with `new_line`.

        If ``once`` is set to True, remove only the first instance.