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

Method __init__

examples/cmd_as_argument.py:23–32  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

21 MUMBLE_LAST = ("right?",)
22
23 def __init__(self) -> None:
24 shortcuts = dict(cmd2.DEFAULT_SHORTCUTS)
25 shortcuts.update({"&": "speak"})
26 # Set include_ipy to True to enable the "ipy" command which runs an interactive IPython shell
27 super().__init__(allow_cli_args=False, include_ipy=True, multiline_commands=["orate"], shortcuts=shortcuts)
28
29 self.self_in_py = True
30 self.maxrepeats = 3
31 # Make maxrepeats settable at runtime
32 self.add_settable(cmd2.Settable("maxrepeats", int, "max repetitions for speak command", self))
33
34 speak_parser = cmd2.Cmd2ArgumentParser()
35 speak_parser.add_argument("-p", "--piglatin", action="store_true", help="atinLay")

Callers

nothing calls this directly

Calls 1

add_settableMethod · 0.45

Tested by

no test coverage detected