summaryrefslogtreecommitdiffstats
path: root/pyload
diff options
context:
space:
mode:
Diffstat (limited to 'pyload')
-rw-r--r--pyload/config/default.conf14
-rw-r--r--pyload/utils/__init__.py11
2 files changed, 9 insertions, 16 deletions
diff --git a/pyload/config/default.conf b/pyload/config/default.conf
index 9dd36e995..17753bb8c 100644
--- a/pyload/config/default.conf
+++ b/pyload/config/default.conf
@@ -30,13 +30,13 @@ log - "Log":
label;line console_mode : "Colored console mode" = line
general - "General":
- en;de;fr;it;es;nl;sv;ru;pl;cs;sr;pt_BR language : "Language" = en
- folder download_folder : "Download Folder" = Downloads
- bool debug_mode : "Debug Mode" = False
- int min_free_space : "Min Free Space in MB" = 200
- bool folder_per_package : "Create folder for each package" = True
- int renice : "CPU Priority" = 0
- auto;common;pyv8;node;rhino;jsc jsengine : "JS Engine" = auto
+ en; language : "Language" = en
+ folder download_folder : "Download Folder" = Downloads
+ bool debug_mode : "Debug Mode" = False
+ int min_free_space : "Min Free Space in MB" = 200
+ bool folder_per_package : "Create folder for each package" = True
+ int renice : "CPU Priority" = 0
+ auto;common;pyv8;node;rhino;jsc jsengine : "JS Engine" = auto
download - "Download":
int chunks : "Max connections for one download" = 3
diff --git a/pyload/utils/__init__.py b/pyload/utils/__init__.py
index 3d26983b5..da84fe51c 100644
--- a/pyload/utils/__init__.py
+++ b/pyload/utils/__init__.py
@@ -3,6 +3,7 @@
""" Store all useful functions here """
+import bitmath
import os
import re
import sys
@@ -91,7 +92,6 @@ def save_join(*args):
if sys.getfilesystemencoding().startswith('ANSI'):
-
def fs_encode(string):
return safe_filename(encode(string))
@@ -131,13 +131,7 @@ def compare_time(start, end):
def formatSize(size):
"""formats size of bytes"""
- size = int(size)
- steps = 0
- sizes = ("B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB")
- while size > 1000:
- size /= 1024.0
- steps += 1
- return "%.2f %s" % (size, sizes[steps])
+ return bitmath.Byte(int(size)).best_prefix()
def formatSpeed(speed):
@@ -213,7 +207,6 @@ def parseFileSize(string, unit=None): #: returns bytes
def lock(func):
-
def new(*args):
# print "Handler: %s args: %s" % (func, args[1:])
args[0].lock.acquire()