summaryrefslogtreecommitdiffstats
path: root/textw/progress_text.py
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2006-02-10 14:35:58 +0000
committerDavid Cantrell <dcantrell@redhat.com>2006-02-10 14:35:58 +0000
commitf91c501480d9e8ec8035e54b3bf5d01805c5213c (patch)
tree5cc8fc83377f6686a9d92a45db2f84fcc83c276b /textw/progress_text.py
parentc68f2b80ad13bddd63b7f54a16b1ce95cde65318 (diff)
downloadanaconda-f91c501480d9e8ec8035e54b3bf5d01805c5213c.tar.gz
anaconda-f91c501480d9e8ec8035e54b3bf5d01805c5213c.tar.xz
anaconda-f91c501480d9e8ec8035e54b3bf5d01805c5213c.zip
* textw/progress_text.py (InstallProgressWindow.setPackage): If a
package name is longer than 48 chars, trim to 45 and add '...' on the end (#180469).
Diffstat (limited to 'textw/progress_text.py')
-rw-r--r--textw/progress_text.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/textw/progress_text.py b/textw/progress_text.py
index e989ff443..cf1de39f2 100644
--- a/textw/progress_text.py
+++ b/textw/progress_text.py
@@ -71,10 +71,14 @@ class InstallProgressWindow:
self.screen.refresh()
def setPackage(self, header):
- self.name.setText("%s-%s-%s-%s" % (header[rpm.RPMTAG_NAME],
- header[rpm.RPMTAG_VERSION],
- header[rpm.RPMTAG_RELEASE],
- header[rpm.RPMTAG_ARCH]))
+ pkgname = "%s-%s-%s-%s" % (header[rpm.RPMTAG_NAME],
+ header[rpm.RPMTAG_VERSION],
+ header[rpm.RPMTAG_RELEASE],
+ header[rpm.RPMTAG_ARCH])
+ if len(pkgname) > 48:
+ pkgname = "%s..." %(pkgname[1:45])
+
+ self.name.setText(pkgname)
self.size.setText("%dk" % (header[rpm.RPMTAG_SIZE] / 1024))
summary = header[rpm.RPMTAG_SUMMARY]
if (summary != None):