summaryrefslogtreecommitdiffstats
path: root/module/gui/Queue.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2011-02-13 20:45:33 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2011-02-13 20:45:33 +0100
commit4c39545bbeb661c564b392fe3ff28fab2713a53e (patch)
treeadcfc665f8b1f83b6d608c994bd21b166be24910 /module/gui/Queue.py
parentfixes + improvements (diff)
downloadpyload-4c39545bbeb661c564b392fe3ff28fab2713a53e.tar.xz
collector size
Diffstat (limited to 'module/gui/Queue.py')
-rw-r--r--module/gui/Queue.py14
1 files changed, 1 insertions, 13 deletions
diff --git a/module/gui/Queue.py b/module/gui/Queue.py
index 977dd6e9a..94025c867 100644
--- a/module/gui/Queue.py
+++ b/module/gui/Queue.py
@@ -23,19 +23,7 @@ from module.remote.thriftbackend.thriftgen.pyload.ttypes import *
from time import sleep, time
-from module.gui.Collector import CollectorModel, Package, Link, CollectorView, statusMap, statusMapReverse
-
-def formatSize(size):
- """formats size of bytes"""
- size = int(size)
- steps = 0
- sizes = ["B", "KiB", "MiB", "GiB", "TiB"]
-
- while size > 1000:
- size /= 1024.0
- steps += 1
-
- return "%.2f %s" % (size, sizes[steps])
+from module.gui.Collector import CollectorModel, Package, Link, CollectorView, statusMap, statusMapReverse, formatSize
def formatSpeed(speed):
speed = int(speed)