]>
git.ipfire.org Git - people/shoehn/ipfire.org.git/blob - www/webapp/helpers.py
4 def __init__(self
, **args
):
7 def __getattr__(self
, key
):
10 def __getitem__(self
, key
):
13 def __setitem__(self
, key
, val
):
18 suffixes
= ["B", "K", "M", "G", "T",]
21 while s
>= 1024 and idx
< len(suffixes
):
25 return "%.2f %s" % (s
, suffixes
[idx
])