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

Method preloop

cmd2/cmd2.py:2846–2853  ·  view source on GitHub ↗

Ran once when the [cmd2.Cmd.cmdloop][] method is called (cmd inherited Hook method). This method is a stub that does nothing and exists to be overridden by subclasses. See [cmd2.Cmd.register_preloop_hook][] for a more robust wayto run hooks before the command loop begins. S

(self)

Source from the content-addressed store, hash-verified

2844 return stop
2845
2846 def preloop(self) -> None:
2847 """Ran once when the [cmd2.Cmd.cmdloop][] method is called (cmd inherited Hook method).
2848
2849 This method is a stub that does nothing and exists to be overridden by subclasses.
2850
2851 See [cmd2.Cmd.register_preloop_hook][] for a more robust wayto run hooks before the command loop begins.
2852 See [Hooks](../features/hooks.md) for more information.
2853 """
2854
2855 def postloop(self) -> None:
2856 """Ran once when the [cmd2.Cmd.cmdloop][] method is about to return (cmd inherited Hook Method).

Callers 3

cmdloopMethod · 0.95
fixture_setupMethod · 0.80
event_loops.pyFile · 0.80

Calls

no outgoing calls

Tested by 1

fixture_setupMethod · 0.64