From: Han-Wen Nienhuys Date: Wed, 20 Dec 2006 01:49:13 +0000 (+0100) Subject: shorten strings in table header too. X-Git-Tag: release/2.11.4-1~13^2~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=04ef1e97f47b40ae2782d20a5c30b0adeb321d59;p=lilypond.git shorten strings in table header too. --- diff --git a/buildscripts/output-distance.py b/buildscripts/output-distance.py index d3ef36b3c6..a04df6b540 100644 --- a/buildscripts/output-distance.py +++ b/buildscripts/output-distance.py @@ -19,6 +19,12 @@ OUTPUT_EXPRESSION_PENALTY = 1 ORPHAN_GROB_PENALTY = 1 inspect_max_count = 0 +def shorten_string (s): + threshold = 15 + if len (s) > 2*threshold: + s = s[:threshold] + '..' + s[-threshold:] + return s + def max_distance (x1, x2): dist = 0.0 @@ -648,12 +654,14 @@ class ComparisonData: html += link.html_record_string (dir1, dir2) + short_dir1 = shorten_string (dir1) + short_dir2 = shorten_string (dir2) html = ''' - - + + %(html)s
distance%(dir1)s%(dir2)s%(short_dir1)s%(short_dir2)s
@@ -917,8 +925,7 @@ def main (): inspect_max_count = o.max_count name = a[0].replace ('/', '') - if len (name) > 20: - name = name[:10] + '..' + name[-10:] + name = shorten_string (name) compare_trees (a[0], a[1], os.path.join (a[1], 'compare-' + name), o.threshold)