[Yum-devel] Yum output reformat

Michael Favia michael.favia at insitesinc.com
Fri Jan 28 00:56:49 UTC 2005


Over the next few days i will be sending in a number of patches in my 
quest to clean up the output from yum. A few of these changes have been 
requested and a number of them, like this one, are just my opinion on 
how to make things look better.

This patch unifies the look of all the progress bars in yum output. To 
accomplish this i added a "Percent complete section, reduced the size of 
the meter to 25 marks and added "|" caps on both ends (with all 
necessary buffering). I also added 2 spaces before the output of the 
repo because as you'll see in my following patches i am trying to give 
users the feel of distinct progress from one phase of the depresolution 
process to the next. All that was required was a couple of formatting 
lines. I cant find where the formatting for the urlgrabber lines is done 
(to add 2 spaces to the beginning of setting up repos and such). If 
anyone could point me in the right direction id appreciate it. Comments 
welcome. Here is some sample output and the patch:

Example Output:

Setting up Install Process

Setting up Repos

base                      100% |=========================| 1.1 kB    00:00

updates-released          100% |=========================|  951 B    00:00
Reading repository metadata in from local files
  base                    100% |=========================| 2622/2622
  updates-released        100% |=========================| 605/605
Nothing to do

Patch:

? progressBar.txt
Index: output.py
===================================================================
RCS file: /cvsroot/yum/cvs/yum/output.py,v
retrieving revision 1.45
diff -r1.45 output.py
49c49
<         """simple progress bar 50 # marks"""
---
>         """simple progress bar 25 = marks"""
51c51
<         mark = '#'
---
>         mark = '='
63c63
<         numblocks = int(percent/2)
---
>         numblocks = int(percent/4)
66c66
<             output = '\r%-50s %d/%d' % (hashbar, current, total)
---
>             output = '\r  |%-23s| %d/%d' % (hashbar, current, total)
68c68
<             output = '\r%-10.10s: %-50s %d/%d' % (name, hashbar, current, total)
---
>             output = '\r  %-23.23s %+3.3s%% |%-25s| %d/%d' % (name, percent, hashbar, current, total)


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: progressBar.txt
Url: http://lists.baseurl.org/pipermail/yum-devel/attachments/20050127/14712f05/attachment.txt 


More information about the Yum-devel mailing list