コード例 #1
0
 def filterFile(self, inFile, writeFile):
     fromlines = open(self.origFileName, "rU").readlines()
     tolines = inFile.readlines()
     fpdiff.fpfilter(fromlines, tolines, writeFile, self.tolerance, self.relative)
コード例 #2
0
ファイル: runner.py プロジェクト: p1tt1/sumo
        if '<net>' in l:
            skippedHeader = True
        if not skippedHeader:
            continue
        if '<location' in l:
            continue
        if '<projection' in l:
            continue
        result.append(l)
    return result


args1 = [netconvert,
        '--sumo-net-file', net_input,
        '--dlr-navteq-output', dlr_navteq_prefix]

args2 = [netconvert,
        '--dlr-navteq-prefix', dlr_navteq_prefix,
        '--output', net_output]

subprocess.call(args1)
subprocess.call(args2)

fromlines = filter(open(net_input, 'U').readlines())
tolines = filter(open(net_output, 'U').readlines())
out = StringIO.StringIO()
fpdiff.fpfilter(fromlines, tolines, out, 0.0201)
out.seek(0)
tolines = out.readlines()
sys.stderr.writelines(difflib.unified_diff(fromlines, tolines))
コード例 #3
0
 def filterFile(self, inFile, writeFile):
     fromlines = open(self.origFileName, "rU").readlines()
     tolines = inFile.readlines()
     fpdiff.fpfilter(fromlines, tolines, writeFile, self.tolerance, self.relative)