summaryrefslogtreecommitdiff
path: root/en/pythonpath/lightproof_impl_en.py
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2014-05-15 13:03:17 +0200
committerAndras Timar <andras.timar@collabora.com>2014-05-18 22:17:00 +0200
commit7ff2a6c889831d22af168f311ee8cfd01983a350 (patch)
tree0b647dbebc9e4d84833f0a350f9e032be53fad66 /en/pythonpath/lightproof_impl_en.py
parent80952c97ed50d4571fea14de3dfec7185824fe3e (diff)
fix LightProof measurement conversion for Python 3 cp-4.2-6cp-4.2-5cp-4.2-4
Change-Id: I6d36bc804271956e1c8649df0832615311fcf5e1 Reviewed-on: https://gerrit.libreoffice.org/#/c/9367 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'en/pythonpath/lightproof_impl_en.py')
-rw-r--r--en/pythonpath/lightproof_impl_en.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/en/pythonpath/lightproof_impl_en.py b/en/pythonpath/lightproof_impl_en.py
index 2c7072c..ac668dc 100644
--- a/en/pythonpath/lightproof_impl_en.py
+++ b/en/pythonpath/lightproof_impl_en.py
@@ -328,7 +328,7 @@ def measurement(mnum, min, mout, mstr, decimal, remove):
mnum = mnum.replace(" 1/2", ".5").replace(u" \xbd", ".5").replace(u"\xbd",".5")
m = calc("CONVERT_ADD", (float(eval(mnum.replace(remove, "").replace(decimal, ".").replace(u"\u2212", "-"))), min, mout))
a = list(set([str(calc("ROUND", (m, 0)))[:-2], str(calc("ROUND", (m, 1))), str(calc("ROUND", (m, 2))), str(m)])) # remove duplicated rounded items
- a.sort(lambda x, y: len(x) - len(y)) # sort by string length
+ a.sort(key=lambda x: len(x)) # sort by string length
return (mstr + "\n").join(a).replace(".", decimal).replace("-", u"\u2212") + mstr