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

Method __init__

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

Source from the content-addressed store, hash-verified

1066 # Declare a commandset with duplicate settable name
1067 class WithSettablesB(CommandSetBase):
1068 def __init__(self) -> None:
1069 super().__init__()
1070
1071 self._arbitrary = Arbitrary()
1072 self._settable_prefix = "some"
1073 self.my_int = 11
1074
1075 self.add_settable(
1076 Settable(
1077 "arbitrary_value",
1078 int,
1079 "Some settable value",
1080 settable_object=self._arbitrary,
1081 settable_attrib_name="some_value",
1082 )
1083 )
1084
1085 # create the command set and cmd2
1086 cmdset = WithSettablesA()

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