MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / __init__

Method __init__

examples/environment.py:10–17  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

8 """Example cmd2 application."""
9
10 def __init__(self) -> None:
11 super().__init__()
12 self.degrees_c = 22
13 self.sunny = False
14 self.add_settable(
15 cmd2.Settable("degrees_c", int, "Temperature in Celsius", self, onchange_cb=self._onchange_degrees_c)
16 )
17 self.add_settable(cmd2.Settable("sunny", bool, "Is it sunny outside?", self))
18
19 def do_sunbathe(self, _arg) -> None:
20 """Attempt to sunbathe."""

Callers

nothing calls this directly

Calls 1

add_settableMethod · 0.45

Tested by

no test coverage detected