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

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


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

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