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
return 0.0
else:
return 100.0;
-
def get_content (self, f):
print 'reading', f
return s
-
-
class GitFileCompareLink (FileCompareLink):
def get_cell (self, oldnew):
str = self.contents[oldnew]
str = '<font size="-2"><pre>%s</pre></font>' % 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):
ext = os.path.splitext (f1)[1]
klasses = {
'.midi': MidiFileLink,
- '.log' : TextFileCompareLink,
+ '.log' : LogFileCompareLink,
'.profile': ProfileFileLink,
'.gittxt': GitFileCompareLink,
}
test_compare_signatures (names)
def test_compare_signatures (names, timing=False):
-
import time
times = 1
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()