[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Container/Views/Browser - Contents.py:1.15 main.pt:1.17

Stephan Richter stephan.richter@tufts.edu
Tue, 03 Dec 2002 12:58:08 -0500


On Tuesday 03 December 2002 12:43, runyaga wrote:
> +def getSize(obj):
> +    try:
> +        size=int(obj.getSize())
> +    except (AttributeError, ValueError):
> +        return u'N/A'
> +
> +    result = u''
> +    if size < 1024:
> +        result = "1 KB"
> +    elif size > 1048576:
> +        result = "%0.02f MB" % (size / 1048576.0)
> +    else:
> +        result = "%d KB" % (size / 1024.0)
> +    return result

Mmmh, Steve and I had already much more advanced ideas about this. 
Unfortunately I did not write up a proposal, but ask Steve, since he is right 
there in Rotterdam, about displaying sizes...

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training