]> git.donarmstrong.com Git - lilypond.git/commitdiff
(ComparisonData.create_html_result_page): new routine: summarise
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 29 May 2006 12:56:21 +0000 (12:56 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 29 May 2006 12:56:21 +0000 (12:56 +0000)
results in HTML page with images.
(ComparisonData.create_text_result_page): create summary text files too.

ChangeLog
buildscripts/output-distance.py

index eddfcb2c806228d3dbc3689d6b1fbbc4a1d9b002..6408308491dd745662ff1f316207821ff5bda2e7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,11 @@
 2006-05-29  Han-Wen Nienhuys  <hanwen@lilypond.org>
 
+       * BackportmeStart.
+       
        * buildscripts/output-distance.py
        (ComparisonData.create_html_result_page): new routine: summarise
-       results in HTML page with images. BackportmeStart.
+       results in HTML page with images. 
+       (ComparisonData.create_text_result_page): create summary text files too.
 
        * GNUmakefile.in (web-ext): package .signature files too. They
        compress well. 
index 84ca8bd82fcd7b8889696d25113ca4a437018d03..ddd3263fce2ae87fe2a78301d0372ae7f8e4289d 100644 (file)
@@ -240,18 +240,28 @@ class ComparisonData:
             distance = compare_signature_files (f1, f2)
             self.result_dict[f2] = (distance, f1)
     
-    def print_results (self):
+    def create_text_result_page (self, filename):
+
+        out = None
+        if filename == '':
+            out = sys.stdout
+        else:
+            out = file (filename, 'w')
+        
         results = [(score, oldfile, file) for (file, (score, oldfile)) in self.result_dict.items ()]  
         results.sort ()
         results.reverse ()
 
         for (s, oldfile, f) in results:
-            print '%30s %6f' % (f,s)
+            out.write ('%-30f %-20s\n' % (s, f))
 
         for (dir, file) in self.missing:
-            print '%-20s %s' % ('missing',os.path.join (dir, file))
+            out.write ('%10s%-20s %s\n' % ('', 'missing',os.path.join (dir, file)))
         for (dir, file) in self.added:
-            print '%10s%-10s %s' % ('','added', os.path.join (dir, file))
+            out.write ('%20s%-10s %s\n' % ('','added', os.path.join (dir, file)))
+
+    def print_results (self):
+        self.create_text_result_page ('')
         
     def create_html_result_page (self, dir1, dir2):
         dir1 = dir1.replace ('//', '/')