projects
/
Plinn.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Slides / thumbnails plus grandes.
[Plinn.git]
/
skins
/
generic
/
sizehr.py
1
##parameters=size
2
3
ko
=
1
4
unitIndex
=
0
5
units
= [
'o'
,
'Ko'
,
'Mo'
,
'Go'
]
6
while
float
(
size
) /
ko
>=
1024
:
7
ko
=
ko
*
1024
8
unitIndex
=
unitIndex
+
1
9
10
return
{
'value'
:
round
(
float
(
size
)/
ko
,
2
),
'unit'
:
units
[
unitIndex
]}