[rtems-source-builder commit] sb: Fix the sensible url printer on Python3.

Chris Johns chrisj at rtems.org
Thu Mar 17 07:33:24 UTC 2016


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

Author:    Chris Johns <chrisj at rtems.org>
Date:      Thu Mar 17 18:26:37 2016 +1100

sb: Fix the sensible url printer on Python3.

Updates #2656.

---

 source-builder/sb/download.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/source-builder/sb/download.py b/source-builder/sb/download.py
index 0d62e34..e140708 100644
--- a/source-builder/sb/download.py
+++ b/source-builder/sb/download.py
@@ -70,9 +70,12 @@ def _humanize_bytes(bytes, precision = 1):
     return '%.*f%s' % (precision, float(bytes) / factor, suffix)
 
 def _sensible_url(url, used = 0):
-    space = 150 - used - 15
+    if used < 140:
+        space = 150 - used - 15
+    else:
+        space = 20
     if len(url) > space:
-        size = (space - 5) / 2
+        size = int((space - 5) / 2)
         url = url[:size] + ' ... ' + url[-size:]
     return url
 



More information about the vc mailing list