[yum-git] output.py

James Antill james at linux.duke.edu
Tue Jan 22 15:15:17 UTC 2008


 output.py |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 6cccf707993f2d46c5cda7c92681eb702e9821aa
Author: James Antill <james at and.org>
Date:   Tue Jan 22 10:14:28 2008 -0500

    Wrap the output for search results

diff --git a/output.py b/output.py
index 8f81873..76adbcd 100644
--- a/output.py
+++ b/output.py
@@ -36,6 +36,8 @@ from yum.constants import *
 from yum import logginglevels
 from yum.rpmtrans import RPMBaseCallback
 
+from textwrap import fill
+
 class YumTextMeter(TextMeter):
 
     """
@@ -414,7 +416,10 @@ class YumOutput:
         return(format % (number, space, symbols[depth]))
 
     def matchcallback(self, po, values, matchfor=None):
-        msg = '%s.%s : %s' % (po.name, po.arch, po.summary)
+        msg = '%s.%s : ' % (po.name, po.arch)
+        msg_nxt = ' ' * (len(msg) - 2) + ': '
+        msg = fill(po.summary, width=self.term.columns,
+                   initial_indent=msg, subsequent_indent=msg_nxt)
         if matchfor:
             msg = self.term.sub_bold(msg, matchfor)
         



More information about the Yum-cvs-commits mailing list