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

Class LoadableBadBase

tests/test_commandset.py:450–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

448
449
450class LoadableBadBase(cmd2.CommandSet):
451 def __init__(self, dummy) -> None:
452 super().__init__()
453 self._dummy = dummy # prevents autoload
454
455 def do_cut(self, ns: argparse.Namespace) -> None:
456 """Cut something"""
457 handler = ns.cmd2_subcmd_handler
458 if handler is not None:
459 # Call whatever subcommand function was selected
460 handler(ns)
461 else:
462 # No subcommand was provided, so call help
463 self._cmd.poutput("This command does nothing without sub-parsers registered")
464 self._cmd.do_help("cut")
465
466
467class LoadableFruits(cmd2.CommandSet):

Callers 1

test_subcommandsFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_subcommandsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…