def line_process(self, line):
    changed = False
    for rule in self.rules:
        line1 = rule.replace(line)
        if (line1 != line):
            changed = True
        line = line1
    return (changed, line)
def line_process(self, line):
    changed = False
    for rule in self.rules:
        line1 = rule.replace(line)
        if (line1 != line):
            changed = True
        line = line1
    return (changed, line)