[rtems-source-builder commit] sb: Make the URL output truncate on long long URLs.

Chris Johns chrisj at rtems.org
Fri Mar 18 02:40:00 UTC 2016


Module:    rtems-source-builder
Branch:    master
Commit:    d44b4d243f638d47495684d73c74ebcbab64a39e
Changeset: http://git.rtems.org/rtems-source-builder/commit/?id=d44b4d243f638d47495684d73c74ebcbab64a39e

Author:    Chris Johns <chrisj at rtems.org>
Date:      Fri Mar 18 13:34:26 2016 +1100

sb: Make the URL output truncate on long long URLs.

---

 source-builder/sb/download.py | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/source-builder/sb/download.py b/source-builder/sb/download.py
index e140708..1bd132e 100644
--- a/source-builder/sb/download.py
+++ b/source-builder/sb/download.py
@@ -70,13 +70,10 @@ def _humanize_bytes(bytes, precision = 1):
     return '%.*f%s' % (precision, float(bytes) / factor, suffix)
 
 def _sensible_url(url, used = 0):
-    if used < 140:
-        space = 150 - used - 15
-    else:
-        space = 20
+    space = 200
     if len(url) > space:
-        size = int((space - 5) / 2)
-        url = url[:size] + ' ... ' + url[-size:]
+        size = int(space - 14)
+        url = url[:size] + '...<see log>'
     return url
 
 def _hash_check(file_, absfile, macros, remove = True):




More information about the vc mailing list