Convert to single codebase for py2 and py3

No more 2to3. Also, added tox config for easy cross-python testing.
This commit is contained in:
Virgil Dupras
2016-11-22 09:13:18 -05:00
parent 0e06eb81dd
commit 20f634028d
15 changed files with 256 additions and 206 deletions

View File

@@ -14,10 +14,10 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA
from __future__ import unicode_literals
from __future__ import unicode_literals, print_function
from .lang_EN import Num2Word_EN
class Num2Word_EN_GB(Num2Word_EN):
def to_currency(self, val, longval=True):
return self.to_splitnum(val, hightxt="pound/s", lowtxt="pence",
@@ -38,9 +38,9 @@ def main():
n2w.test(val)
n2w.test(1325325436067876801768700107601001012212132143210473207540327057320957032975032975093275093275093270957329057320975093272950730)
for val in [1,120,1000,1120,1800, 1976,2000,2010,2099,2171]:
print val, "is", n2w.to_currency(val)
print val, "is", n2w.to_year(val)
print(val, "is", n2w.to_currency(val))
print(val, "is", n2w.to_year(val))
if __name__ == "__main__":
main()