diff options
author | László Németh <nemeth@numbertext.org> | 2012-11-30 17:29:41 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2012-11-30 17:29:41 +0100 |
commit | 8be323a6b7496003419e2587bc4573949fe142dc (patch) | |
tree | dea1ed3f0f1c2e03cfb2161d8072d799b91e0425 /en/pythonpath/lightproof_impl_en.py | |
parent | afc12cc53bf96f765b4513868d3b7530c66711f1 (diff) |
Python 3 port of Lightproof en/hu modules
Diffstat (limited to 'en/pythonpath/lightproof_impl_en.py')
-rw-r--r-- | en/pythonpath/lightproof_impl_en.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/en/pythonpath/lightproof_impl_en.py b/en/pythonpath/lightproof_impl_en.py index dd1adb0..2c7072c 100644 --- a/en/pythonpath/lightproof_impl_en.py +++ b/en/pythonpath/lightproof_impl_en.py @@ -1,6 +1,5 @@ # -*- encoding: UTF-8 -*- import uno, re, sys, os, traceback -from string import join from com.sun.star.text.TextMarkupType import PROOFREADING from com.sun.star.beans import PropertyValue @@ -119,7 +118,7 @@ def suggest(rLoc, word): if not x: return word t = x.getAlternatives() - suggestions[word] = join(t, "\\n") + suggestions[word] = "\\n".join(t) return suggestions[word] # get the nth word of the input string or None @@ -330,7 +329,7 @@ def measurement(mnum, min, mout, mstr, decimal, remove): 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 - return join(a, mstr + "\n").replace(".", decimal).replace("-", u"\u2212") + mstr + return (mstr + "\n").join(a).replace(".", decimal).replace("-", u"\u2212") + mstr |