From 1054dda76b87d9f7f77311d8d804c1017b668996 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Thu, 3 Sep 2020 23:04:54 -0400 Subject: Fixed type hints in example code --- docs/features/modular_commands.rst | 2 +- examples/modular_subcommands.py | 2 +- tests_isolated/test_commandset/test_commandset.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/features/modular_commands.rst b/docs/features/modular_commands.rst index 611660ff..6159bc41 100644 --- a/docs/features/modular_commands.rst +++ b/docs/features/modular_commands.rst @@ -293,7 +293,7 @@ command and each CommandSet bokchoy_parser.add_argument('style', choices=['quartered', 'diced']) @cmd2.as_subcommand_to('cut', 'bokchoy', bokchoy_parser) - def cut_bokchoy(self, _: cmd2.Statement): + def cut_bokchoy(self, _: argparse.Namespace): self._cmd.poutput('Bok Choy') diff --git a/examples/modular_subcommands.py b/examples/modular_subcommands.py index 4445fde2..c1d499f0 100644 --- a/examples/modular_subcommands.py +++ b/examples/modular_subcommands.py @@ -46,7 +46,7 @@ class LoadableVegetables(CommandSet): bokchoy_parser.add_argument('style', choices=['quartered', 'diced']) @cmd2.as_subcommand_to('cut', 'bokchoy', bokchoy_parser, help=bokchoy_description.lower()) - def cut_bokchoy(self, _: cmd2.Statement): + def cut_bokchoy(self, _: argparse.Namespace): self._cmd.poutput('Bok Choy') diff --git a/tests_isolated/test_commandset/test_commandset.py b/tests_isolated/test_commandset/test_commandset.py index 1685accf..d7f2523e 100644 --- a/tests_isolated/test_commandset/test_commandset.py +++ b/tests_isolated/test_commandset/test_commandset.py @@ -647,7 +647,7 @@ class AppWithSubCommands(cmd2.Cmd): bokchoy_parser.add_argument('style', completer_method=complete_style_arg) @cmd2.as_subcommand_to('cut', 'bokchoy', bokchoy_parser) - def cut_bokchoy(self, _: cmd2.Statement): + def cut_bokchoy(self, _: argparse.Namespace): self.poutput('Bok Choy') -- cgit v1.2.1