From 7f861d478db844037d14aeb423eaab88a0a47716 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 16 Jul 2009 20:16:27 +0200 Subject: apt/progress/text.py: Limit number of displayed items by display size. --- apt/progress/text.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'apt/progress') diff --git a/apt/progress/text.py b/apt/progress/text.py index 2b2e5f27..4cdd266f 100644 --- a/apt/progress/text.py +++ b/apt/progress/text.py @@ -140,7 +140,10 @@ class AcquireProgress(apt_pkg.AcquireProgress, TextProgress): val = '' if not worker.current_item: if worker.status: - tval += ' [%s]' % worker.status + val = ' [%s]' % worker.status + if len(tval) + len(val) + len(end) >= self._width: + break + tval += val shown = True continue shown = True @@ -166,7 +169,10 @@ class AcquireProgress(apt_pkg.AcquireProgress, TextProgress): val += ']' - tval += val + if len(tval) + len(val) + len(end) >= self._width: + break + else: + tval += val if not shown: tval += ' [Working]' -- cgit v1.2.3