From 30aae7390244fbe349a98a36fa3cabf977141aa0 Mon Sep 17 00:00:00 2001 From: eyaler Date: Fri, 6 Jan 2023 12:55:37 +0200 Subject: [PATCH] fix typo + try to fix isort issue --- bin/num2words | 95 -------------------------------------------- num2words/lang_HE.py | 1 - tests/test_cli.py | 2 +- 3 files changed, 1 insertion(+), 97 deletions(-) delete mode 100755 bin/num2words diff --git a/bin/num2words b/bin/num2words deleted file mode 100755 index 06ff0443..00000000 --- a/bin/num2words +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2003, Taro Ogawa. All Rights Reserved. -# Copyright (c) 2013, Savoir-faire Linux inc. All Rights Reserved. - -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -# MA 02110-1301 USA - -"""num2words: convert numbers into words. - -Usage: - num2words [options] - num2words --list-languages - num2words --list-converters - num2words --help - -Arguments: - Number you want to convert into words - -Options: - -L --list-languages Show all languages. - -C --list-converters Show all converters. - -l --lang= Output language [default: en]. - -t --to= Output converter [default: cardinal]. - -h --help Show this message. - -v --version Show version. - -Examples: - $ num2words 10001 - ten thousand and one - - $ num2words 24,120.10 - twenty-four thousand, one hundred and twenty point one - - $ num2words 24,120.10 -l es - veinticuatro mil ciento veinte punto uno - - $num2words 2.14 -l es --to currency - dos euros con catorce céntimos -""" - -from __future__ import print_function, unicode_literals -import os -import sys -from docopt import docopt -import num2words - -__version__ = "0.5.12" -__license__ = "LGPL" - - -def get_languages(): - return sorted(list(num2words.CONVERTER_CLASSES.keys())) - - -def get_converters(): - return sorted(list(num2words.CONVERTES_TYPES)) - - -def main(): - version = "{}=={}".format(os.path.basename(__file__), __version__) - args = docopt(__doc__, argv=None, help=True, version=version, options_first=False) - if args["--list-languages"]: - for lang in get_languages(): - sys.stdout.write(lang) - sys.stdout.write(os.linesep) - sys.exit(0) - if args["--list-converters"]: - for cvt in get_converters(): - sys.stdout.write(cvt) - sys.stdout.write(os.linesep) - sys.exit(0) - try: - words = num2words.num2words(args[''], lang=args['--lang'], to=args['--to']) - sys.stdout.write(words + os.linesep) - sys.exit(0) - except Exception as err: - sys.stderr.write(str(args[''])) - sys.stderr.write(str(err) + os.linesep) - sys.stderr.write(__doc__) - sys.exit(1) - - -if __name__ == '__main__': - main() diff --git a/num2words/lang_HE.py b/num2words/lang_HE.py index fd227889..b114fb46 100644 --- a/num2words/lang_HE.py +++ b/num2words/lang_HE.py @@ -23,7 +23,6 @@ from .currency import parse_currency_parts from .utils import get_digits, splitbyx - ZERO = (u'אפס',) ONES = { diff --git a/tests/test_cli.py b/tests/test_cli.py index 79610cb7..f4b9b4bb 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -54,7 +54,7 @@ def test_cli_help(self): self.assertTrue(output.err.startswith('Usage:')) def test_cli_list_langs(self): - """You should be able to list all availabe languages + """You should be able to list all available languages """ output = self.cli.run_cmd('--list-languages') self.assertEqual(