From ba1dc5d8c4094d111bd02f300aa6e4bfe889e561 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Fri, 30 Nov 2018 18:47:16 +0100 Subject: [PATCH] tiramisu_parser => tiramisu_cmdline_parser --- README.md | 4 ++-- examples/Hangman/hangman.py | 4 ++-- test/test_simple.py | 6 +++--- tiramisu_parser.py => tiramisu_cmdline_parser.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) rename tiramisu_parser.py => tiramisu_cmdline_parser.py (99%) diff --git a/README.md b/README.md index 3913468..f93d2ff 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,10 @@ Python3 parser for command-line options and arguments using Tiramisu engine. ```python #!/usr/bin/env python3 -from tiramisu_parser import TiramisuParser +from tiramisu_cmdline_parser import TiramisuCmdlineParser from tiramisu import StrOption, BoolOption, SymLinkOption, OptionDescription, \ Config -parser = TiramisuParser() +parser = TiramisuCmdlineParser() booloption = BoolOption('verbosity', 'increase output verbosity', default=False) diff --git a/examples/Hangman/hangman.py b/examples/Hangman/hangman.py index 9536b49..e7d3fdf 100644 --- a/examples/Hangman/hangman.py +++ b/examples/Hangman/hangman.py @@ -11,7 +11,7 @@ from os.path import isfile from tiramisu import RegexpOption, OptionDescription, Config, IntOption, UnicodeOption, BoolOption, ParamOption, Params from tiramisu.storage import storage_type from tiramisu.storage.sqlite3.storage import SETTING -from tiramisu_parser import TiramisuParser +from tiramisu_cmdline_parser import TiramisuCmdlineParser LANG = 'fr_FR' @@ -149,7 +149,7 @@ def main(): # options) storage_type.set('sqlite3') config = Config(OptionDescription('root', 'root', [word, proposal_word, misses, proposals_left] + options), persistent=True, session_id='hangman') - parser = TiramisuParser() + parser = TiramisuCmdlineParser() parser.add_arguments(config) try: parser.parse_args() diff --git a/test/test_simple.py b/test/test_simple.py index b4391aa..8e35473 100644 --- a/test/test_simple.py +++ b/test/test_simple.py @@ -7,8 +7,8 @@ from os.path import join, isdir from contextlib import redirect_stdout, redirect_stderr from argparse import ArgumentParser -#from pouet import TiramisuParser -from tiramisu_parser import TiramisuParser +#from pouet import TiramisuCmdlineParser +from tiramisu_cmdline_parser import TiramisuCmdlineParser DATA_DIR = 'test/data/compare' @@ -76,7 +76,7 @@ def test_files(test_list): ['bar', '--verbosity'], ['--verbosity', 'bar'], ] for arg in args: - tiramparser = TiramisuParser('prog.py') + tiramparser = TiramisuCmdlineParser('prog.py') tiramparser_dict, tiramparser_system_err, tiramparser_error, tiramparser_help = import_subfile_and_test(test_list + '/tiramisu.py', tiramparser, arg) # diff --git a/tiramisu_parser.py b/tiramisu_cmdline_parser.py similarity index 99% rename from tiramisu_parser.py rename to tiramisu_cmdline_parser.py index e0e2c7e..c7e7809 100644 --- a/tiramisu_parser.py +++ b/tiramisu_cmdline_parser.py @@ -52,7 +52,7 @@ class TiramisuNamespace(Namespace): return super().__getattribute__(key) -class TiramisuParser(ArgumentParser): +class TiramisuCmdlineParser(ArgumentParser): def __init__(self, *args, **kwargs): self.config = None super().__init__(*args, **kwargs)