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

Method __init__

examples/mixin.py:40–47  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

38 """
39
40 def __init__(self, *args, **kwargs) -> None:
41 # code placed here runs before cmd2 initializes
42 super().__init__(*args, **kwargs)
43 # code placed here runs after cmd2 initializes
44 # this is where you register any hook functions
45 self.register_preloop_hook(self.cmd2_mymixin_preloop_hook)
46 self.register_postloop_hook(self.cmd2_mymixin_postloop_hook)
47 self.register_postparsing_hook(self.cmd2_mymixin_postparsing_hook)
48
49 def do_say(self, statement) -> None:
50 """Simple say command."""

Callers 1

__init__Method · 0.45

Calls 3

register_preloop_hookMethod · 0.80

Tested by

no test coverage detected