aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfuzzyray <fuzzyray@gentoo.org>2010-09-22 21:24:05 +0000
committerfuzzyray <fuzzyray@gentoo.org>2010-09-22 21:24:05 +0000
commitdad8dce2d4363d4c80bd85770e4f02ad9e92af7d (patch)
treedaed7dc879280b66a2d8321df0badb2dc9e82229 /pym/gentoolkit/eclean
parentMerge from genscripts r440: brian.dolbec (diff)
downloadgentoolkit-dad8dce2d4363d4c80bd85770e4f02ad9e92af7d.tar.gz
gentoolkit-dad8dce2d4363d4c80bd85770e4f02ad9e92af7d.tar.bz2
gentoolkit-dad8dce2d4363d4c80bd85770e4f02ad9e92af7d.zip
Merge from genscripts r448: brian.dolbec
Fix the output of the deprecated pkg information to reflect whether it was able to save their sources or not. Merge from genscripts r439: brian.dolbec fix the prettySize output errors introduced when I removed the deprecated formatting style previously used. This now properly displays the rounded file sizes. svn path=/trunk/gentoolkit/; revision=807
Diffstat (limited to 'pym/gentoolkit/eclean')
-rw-r--r--pym/gentoolkit/eclean/output.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/pym/gentoolkit/eclean/output.py b/pym/gentoolkit/eclean/output.py
index 670e67c..c8c3f78 100644
--- a/pym/gentoolkit/eclean/output.py
+++ b/pym/gentoolkit/eclean/output.py
@@ -91,14 +91,18 @@ class OutputControl(object):
color = self.numbers
units = [" G"," M"," K"," B"]
approx = 0
+ # by using 1000 as the changeover, the integer portion
+ # of the number will never be more than 3 digits long
+ # but the true base 2 value of 1024 is used for the actual
+ # calulation to maintain better accuracy.
while len(units) and size >= 1000:
approx = 1
- size = size / 1024.
+ size = size / 1024.0
units.pop()
- sizestr = '%d'% size + units[-1]
+ sizestr = "%.1f" %(round(size,1)) + units[-1]
if justify:
sizestr = " " + self.brace("[ ") + \
- color(sizestr.rjust(7)) + self.brace(" ]")
+ color(sizestr.rjust(8)) + self.brace(" ]")
return sizestr
def yesNoAllPrompt(self, message="Do you want to proceed?"):
@@ -175,5 +179,9 @@ class OutputControl(object):
"""
indent = ' ' * 12
for key in pkgs:
- print( indent,self.pkg_color(key))
+ if pkgs[key]:
+ saved = ""
+ else:
+ saved = " ...distfile name(s) not known/saved"
+ print( indent,self.pkg_color(key) + saved)
print()