[Catalog-sig] File size listing in cheeseshop

Benji York benji at benjiyork.com
Fri Feb 22 19:09:00 CET 2008


Joseph Armbruster wrote:
> Index: webui.py
> ===================================================================
> --- webui.py	(revision 524)
> +++ webui.py	(working copy)
> @@ -1572,9 +1572,9 @@
>      def pretty_size(self, size):
>          n = 0
>          while size > 1024:
> -            size /= 1024
> +            size /= 1024.0
>              n += 1
> -        return '%d%sB'%(size, ['', 'K', 'M', 'G'][n])
> +        return '%f%sB'%(size, ['', 'K', 'M', 'G'][n])


The fact that this code doesn't work for files larger than 1024 Gig 
really worries me.


;)  <-- wink for the sarcasm-challenged
-- 
Benji York
http://benjiyork.com


More information about the Catalog-SIG mailing list