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

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


Module:    rtems-source-builder
Branch:    4.11
Commit:    87434f6a7cd5f9d723088f4b6a19046be28b61a6
Changeset: http://git.rtems.org/rtems-source-builder/commit/?id=87434f6a7cd5f9d723088f4b6a19046be28b61a6

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