[blivet:master+? 2/9] Translate less eagerly in Size.humanReadable()

mulhern amulhern at redhat.com
Thu Oct 23 17:57:02 UTC 2014


The only prefix or abbreviation that needs to be translated is the
one that is displayed, so translate just that one.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 blivet/size.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/blivet/size.py b/blivet/size.py
index 3b0c0b0..ca51bf8 100644
--- a/blivet/size.py
+++ b/blivet/size.py
@@ -339,7 +339,7 @@ class Size(Decimal):
         # _BINARY_FACTOR * min_value to the left of the decimal point.
         # If the number is so large that no prefix will satisfy this
         # requirement use the largest prefix.
-        for factor, _prefix, abbr in itertools.chain([_EMPTY_PREFIX], _xlated_binary_prefixes()):
+        for factor, _prefix, abbr in [_EMPTY_PREFIX] + _BINARY_PREFIXES:
             newcheck = super(Size, self).__div__(Decimal(factor))
 
             if abs(newcheck) < _BINARY_FACTOR * min_value:
@@ -360,4 +360,4 @@ class Size(Decimal):
             retval_str = retval_str.replace('.', radix)
 
         # pylint: disable=undefined-loop-variable
-        return retval_str + " " + abbr + _("B")
+        return retval_str + " " + _(abbr) + _("B")
-- 
1.9.3



More information about the anaconda-patches mailing list