diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-07-16 20:16:27 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-07-16 20:16:27 +0200 |
| commit | 7f861d478db844037d14aeb423eaab88a0a47716 (patch) | |
| tree | 2d850c9be3eb059d04d6c2e80a6e15f0b414c1f6 | |
| parent | 212ab0a6b95395bad245eb18d4aa710b01b24e9e (diff) | |
| download | python-apt-7f861d478db844037d14aeb423eaab88a0a47716.tar.gz | |
apt/progress/text.py: Limit number of displayed items by display size.
| -rw-r--r-- | apt/progress/text.py | 10 |
1 files changed, 8 insertions, 2 deletions
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]' |
