def file_process(self, path, write=False, root=''):
    out = ''
    nr = 0
    for line in j.sal.fs.readFile(path).split('\n'):
        nr += 1
        (changed, line2) = self.line_process(line)
        if changed:
            path2 = j.sal.fs.pathRemoveDirPart(path, root)
            if (path2 not in self.changes):
                self.changes[path2] = {}
            changes = self.changes[path2]
            changes['line'] = nr
            changes['from'] = line
            changes['to..'] = line2
            out += ('%s\n' % line2)
        else:
            out += ('%s\n' % line)
    if ((len(self.changes) > 0) and write):
        j.sal.fs.writeFile(path, out)
def file_process(self, path, write=False, root=):
    out = 
    nr = 0
    for line in j.sal.fs.readFile(path).split('\n'):
        nr += 1
        (changed, line2) = self.line_process(line)
        if changed:
            path2 = j.sal.fs.pathRemoveDirPart(path, root)
            if (path2 not in self.changes):
                self.changes[path2] = {}
            changes = self.changes[path2]
            changes['line'] = nr
            changes['from'] = line
            changes['to..'] = line2
            out += ('%s\n' % line2)
        else:
            out += ('%s\n' % line)
    if ((len(self.changes) > 0) and write):
        j.sal.fs.writeFile(path, out)