diff options
author | Stefano <l.stickell@yahoo.it> | 2013-04-05 15:39:49 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2013-04-05 15:39:49 +0200 |
commit | f4eb431e76ec3bd6bd743759d0f0c715cee7ae26 (patch) | |
tree | 8a2f067bcc6822bc560966befcaaa9bfd985bef1 /module/utils/__init__.py | |
parent | fixed account table header (diff) | |
download | pyload-f4eb431e76ec3bd6bd743759d0f0c715cee7ae26.tar.xz |
parseFileSize fix
parseFileSize fails if decimal point is not followed by decimal digits (like 5. KB)
Diffstat (limited to 'module/utils/__init__.py')
-rw-r--r-- | module/utils/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/module/utils/__init__.py b/module/utils/__init__.py index 901f553e7..ca00f9abe 100644 --- a/module/utils/__init__.py +++ b/module/utils/__init__.py @@ -108,7 +108,7 @@ def bits_set(bits, compare): def parseFileSize(string, unit=None): #returns bytes if not unit: - m = re.match(r"(\d*[\.,]?\d+)(.*)", string.strip().lower()) + m = re.match(r"([\d.,]+) *([a-zA-Z]*)", string.strip().lower()) if m: traffic = float(m.group(1).replace(",", ".")) unit = m.group(2) |