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

Class SigintHandledCommandSet

tests/test_commandset.py:642–650  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

640 # shows that the command is able to continue execution if the sigint_handler
641 # returns True that we've handled interrupting the command.
642 class SigintHandledCommandSet(cmd2.CommandSet):
643 def do_foo(self, _) -> None:
644 """Foo Command"""
645 self._cmd.poutput("in foo")
646 self._cmd.sigint_handler(signal.SIGINT, None)
647 self._cmd.poutput("end of foo")
648
649 def sigint_handler(self) -> bool:
650 return True
651
652 cs1 = SigintHandledCommandSet()
653 manual_command_sets_app.register_command_set(cs1)

Callers 1

test_commandset_sigintFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_commandset_sigintFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…