From e6da8596c433f46bc337c7e8a14c7de1b0310e4c Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Thu, 13 Aug 2020 14:19:05 -0400 Subject: Replaced choices_function / choices_method with choices_provider. Replaced completer_function / completer_method with completer. ArgparseCompleter now always passes cmd2.Cmd or CommandSet instance as the self argument to choices_provider and completer functions. Moved basic_complete from utils into cmd2.Cmd class. Moved CompletionError to exceptions.py --- examples/modular_commands/commandset_complex.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'examples/modular_commands/commandset_complex.py') diff --git a/examples/modular_commands/commandset_complex.py b/examples/modular_commands/commandset_complex.py index 7c6b1300..a4343ae3 100644 --- a/examples/modular_commands/commandset_complex.py +++ b/examples/modular_commands/commandset_complex.py @@ -8,7 +8,6 @@ import argparse from typing import List import cmd2 -from cmd2 import utils @cmd2.with_default_category('Fruits') @@ -42,7 +41,7 @@ class CommandSetA(cmd2.CommandSet): self._cmd.poutput(', '.join(['{}']*len(args)).format(*args)) def complete_durian(self, text: str, line: str, begidx: int, endidx: int) -> List[str]: - return utils.basic_complete(text, line, begidx, endidx, ['stinks', 'smells', 'disgusting']) + return self._cmd.basic_complete(text, line, begidx, endidx, ['stinks', 'smells', 'disgusting']) elderberry_parser = cmd2.Cmd2ArgumentParser('elderberry') elderberry_parser.add_argument('arg1') -- cgit v1.2.1