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

Method enable_category

cmd2/cmd2.py:5625–5639  ·  view source on GitHub ↗

Enable an entire category of commands. :param category: the category to enable

(self, category: str)

Source from the content-addressed store, hash-verified

5623 del self.disabled_commands[command]
5624
5625 def enable_category(self, category: str) -> None:
5626 """Enable an entire category of commands.
5627
5628 :param category: the category to enable
5629 """
5630 # If the category is already enabled, then return
5631 if category not in self.disabled_categories:
5632 return
5633
5634 for command in list(self.disabled_commands):
5635 command_func = self.disabled_commands[command].command_func
5636 if self._get_command_category(command_func) == category:
5637 self.enable_command(command)
5638
5639 del self.disabled_categories[category]
5640
5641 def disable_command(self, command: str, message_to_print: str) -> None:
5642 """Disable a command and replace its functions with disabled versions.

Calls 2

_get_command_categoryMethod · 0.95
enable_commandMethod · 0.95