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

Method __init__

tests/test_commandset.py:1030–1045  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1028 # Declare a CommandSet with a settable of some arbitrary property
1029 class WithSettablesA(CommandSetBase):
1030 def __init__(self) -> None:
1031 super().__init__()
1032
1033 self._arbitrary = Arbitrary()
1034 self._settable_prefix = "addon"
1035 self.my_int = 11
1036
1037 self.add_settable(
1038 Settable(
1039 "arbitrary_value",
1040 int,
1041 "Some settable value",
1042 settable_object=self._arbitrary,
1043 settable_attrib_name="some_value",
1044 )
1045 )
1046
1047 # Declare a CommandSet with an empty settable prefix
1048 class WithSettablesNoPrefix(CommandSetBase):

Callers

nothing calls this directly

Calls 4

SettableClass · 0.90
ArbitraryClass · 0.85
__init__Method · 0.45
add_settableMethod · 0.45

Tested by

no test coverage detected