X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=buildscripts%2Foutput-distance.py;h=8586d2481ab9cb9beb45bcd06c4b64685eee63b7;hb=890bf9e11a81a566d6387999a796c44edeeebe75;hp=ea82a93de9c1c7d32d37ca79836725764aa6b16e;hpb=299cafec50b2f55850b56a5411bef7485edaadec;p=lilypond.git diff --git a/buildscripts/output-distance.py b/buildscripts/output-distance.py index ea82a93de9..8586d2481a 100644 --- a/buildscripts/output-distance.py +++ b/buildscripts/output-distance.py @@ -28,7 +28,7 @@ class TempDirectory: print 'dir is', self.dir def __del__ (self): print 'rm -rf %s' % self.dir - os.system ('rm -rf %s' % self.dir ) + os.system ('rm -rf %s' % self.dir) def __call__ (self): return self.dir @@ -436,7 +436,6 @@ class FileCompareLink (FileLink): return 0.0 else: return 100.0; - def get_content (self, f): print 'reading', f @@ -444,8 +443,6 @@ class FileCompareLink (FileLink): return s - - class GitFileCompareLink (FileCompareLink): def get_cell (self, oldnew): str = self.contents[oldnew] @@ -487,6 +484,11 @@ class TextFileCompareLink (FileCompareLink): str = '
%s
' % str return str +class LogFileCompareLink (TextFileCompareLink): + def get_content (self, f): + c = TextFileCompareLink.get_content (self, f) + c = re.sub ("\nProcessing `[^\n]+'\n", '', c) + return c class ProfileFileLink (FileCompareLink): def __init__ (self, f1, f2): @@ -577,8 +579,6 @@ class SignatureFileLink (FileLink): return d + orphan_distance - - def add_file_compare (self, f1, f2): system_index = [] @@ -611,8 +611,8 @@ class SignatureFileLink (FileLink): outfile = (dest_dir + '/' + f).replace ('.eps', '.png') data_option = '' if options.local_data_dir: - data_option = ('-slilypond-datadir=%s/share/lilypond/current ' - % os.path.split(infile)[0]) + data_option = ('-slilypond-datadir=%s/../share/lilypond/current ' + % os.path.dirname(infile)) mkdir (os.path.split (outfile)[0]) cmd = ('gs -sDEVICE=png16m -dGraphicsAlphaBits=4 -dTextAlphaBits=4 ' @@ -773,7 +773,7 @@ def paired_files (dir1, dir2, pattern): pairs = [] missing = [] - for f in files[0].keys (): + for f in files[0]: try: files[1].pop (f) pairs.append (f) @@ -847,7 +847,7 @@ class ComparisonData: ext = os.path.splitext (f1)[1] klasses = { '.midi': MidiFileLink, - '.log' : TextFileCompareLink, + '.log' : LogFileCompareLink, '.profile': ProfileFileLink, '.gittxt': GitFileCompareLink, } @@ -1131,7 +1131,6 @@ def test_basic_compare (): test_compare_signatures (names) def test_compare_signatures (names, timing=False): - import time times = 1 @@ -1241,22 +1240,22 @@ def main (): help='where to put the test results [tree2/compare-tree1tree2]') global options - (options, a) = p.parse_args () + (options, args) = p.parse_args () if options.run_test: run_tests () sys.exit (0) - if len (a) != 2: + if len (args) != 2: p.print_usage() sys.exit (2) name = options.output_dir if not name: - name = a[0].replace ('/', '') - name = os.path.join (a[1], 'compare-' + shorten_string (name)) + name = args[0].replace ('/', '') + name = os.path.join (args[1], 'compare-' + shorten_string (name)) - compare_trees (a[0], a[1], name, options.threshold) + compare_trees (args[0], args[1], name, options.threshold) if __name__ == '__main__': main()