Corrected getHumanSize() function when provided request ZTK-1.1
authorThierry Florac <tflorac@ulthar.net>
Sun, 21 Apr 2013 11:24:24 +0200
branchZTK-1.1
changeset 212 0c2257bf3762
parent 211 15d4527f4fbe
child 213 ec49fc38bcb4
Corrected getHumanSize() function when provided request
docs/HISTORY.txt
src/ztfy/utils/size.py
--- a/docs/HISTORY.txt	Sun Apr 21 11:22:41 2013 +0200
+++ b/docs/HISTORY.txt	Sun Apr 21 11:24:24 2013 +0200
@@ -1,6 +1,10 @@
 Changelog
 =========
 
+0.4.2
+-----
+ - small correction in getHumanSize() function
+
 0.4.1
 -----
  - use request locale formatter in getHumanSize function
--- a/src/ztfy/utils/size.py	Sun Apr 21 11:22:41 2013 +0200
+++ b/src/ztfy/utils/size.py	Sun Apr 21 11:24:24 2013 +0200
@@ -33,10 +33,10 @@
     """Convert given bytes value in human readable format"""
     if request is None:
         request = queryRequest()
-        if request is not None:
-            formatter = request.locale.numbers.getFormatter('decimal')
-        else:
-            formatter = None
+    if request is not None:
+        formatter = request.locale.numbers.getFormatter('decimal')
+    else:
+        formatter = None
     if value < 1024:
         return translate(_("%d bytes"), context=request) % value
     value = value / 1024.0