MCPcopy Create free account
hub / github.com/python-cmd2/cmd2 / SupportFuncProvider

Class SupportFuncProvider

tests/test_commandset.py:789–801  ·  view source on GitHub ↗

CommandSet which provides a support function (complete_states) to other CommandSets

Source from the content-addressed store, hash-verified

787
788
789class SupportFuncProvider(cmd2.CommandSet):
790 """CommandSet which provides a support function (complete_states) to other CommandSets"""
791
792 DEFAULT_CATEGORY = "With Completer"
793 states = ("alabama", "alaska", "arizona", "arkansas", "california", "colorado", "connecticut", "delaware")
794
795 def __init__(self, dummy) -> None:
796 """Dummy variable prevents this from being autoloaded in other tests"""
797 super().__init__()
798
799 def complete_states(self, text: str, line: str, begidx: int, endidx: int) -> Completions:
800 assert self is complete_states_expected_self
801 return self._cmd.basic_complete(text, line, begidx, endidx, self.states)
802
803
804class SupportFuncUserSubclass1(SupportFuncProvider):

Callers 1

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…