summaryrefslogtreecommitdiffstats
path: root/module/utils
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-04-05 15:39:49 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2013-04-05 15:39:49 +0200
commitf4eb431e76ec3bd6bd743759d0f0c715cee7ae26 (patch)
tree8a2f067bcc6822bc560966befcaaa9bfd985bef1 /module/utils
parentfixed account table header (diff)
downloadpyload-f4eb431e76ec3bd6bd743759d0f0c715cee7ae26.tar.xz
parseFileSize fix
parseFileSize fails if decimal point is not followed by decimal digits (like 5. KB)
Diffstat (limited to 'module/utils')
-rw-r--r--module/utils/__init__.py2
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)