diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-02-14 21:48:48 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-02-14 21:48:48 +0100 |
commit | dc99fe918b035b3a049493e945d837077f79aac8 (patch) | |
tree | aeaa5f3cdd45c26f93fd75b54658bb7c81d63ee7 /module/web | |
parent | gui DownloadInfo fix (diff) | |
download | pyload-dc99fe918b035b3a049493e945d837077f79aac8.tar.xz |
averaged download speed
Diffstat (limited to 'module/web')
-rw-r--r-- | module/web/pyload_app.py | 4 | ||||
-rw-r--r-- | module/web/utils.py | 12 |
2 files changed, 3 insertions, 13 deletions
diff --git a/module/web/pyload_app.py b/module/web/pyload_app.py index d240564ab..4d6d4354c 100644 --- a/module/web/pyload_app.py +++ b/module/web/pyload_app.py @@ -35,9 +35,11 @@ from bottle import route, static_file, request, response, redirect, HTTPError, e from webinterface import PYLOAD, PROJECT_DIR -from utils import render_to_response, parse_permissions, parse_userdata, formatSize, login_required +from utils import render_to_response, parse_permissions, parse_userdata, login_required from filters import relpath, unquotepath +from module.utils import formatSize + # Helper def pre_processor(): diff --git a/module/web/utils.py b/module/web/utils.py index d7e76f84d..f738560f7 100644 --- a/module/web/utils.py +++ b/module/web/utils.py @@ -44,18 +44,6 @@ def parse_userdata(session): "is_staff": True, "is_authenticated": session.get("authenticated", False)} -def formatSize(size): - """formats size of bytes""" - size = int(size) - steps = 0 - sizes = ["KB", "MB", "GB", "TB"] - - while size > 1000: - size /= 1024.0 - steps += 1 - - return "%.2f %s" % (size, sizes[steps]) - def login_required(perm=None): def _dec(func): def _view(*args, **kwargs): |