public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoolkit r807 - trunk/gentoolkit/pym/gentoolkit/eclean
@ 2010-09-22 21:24 Paul Varner (fuzzyray)
  0 siblings, 0 replies; only message in thread
From: Paul Varner (fuzzyray) @ 2010-09-22 21:24 UTC (permalink / raw
  To: gentoo-commits

Author: fuzzyray
Date: 2010-09-22 21:24:05 +0000 (Wed, 22 Sep 2010)
New Revision: 807

Modified:
   trunk/gentoolkit/pym/gentoolkit/eclean/output.py
Log:
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.


Modified: trunk/gentoolkit/pym/gentoolkit/eclean/output.py
===================================================================
--- trunk/gentoolkit/pym/gentoolkit/eclean/output.py	2010-09-22 21:20:46 UTC (rev 806)
+++ trunk/gentoolkit/pym/gentoolkit/eclean/output.py	2010-09-22 21:24:05 UTC (rev 807)
@@ -91,14 +91,18 @@
 			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 @@
 		"""
 		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()




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-09-22 21:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-22 21:24 [gentoo-commits] gentoolkit r807 - trunk/gentoolkit/pym/gentoolkit/eclean Paul Varner (fuzzyray)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox