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

Method register_cmdfinalization_hook

cmd2/cmd2.py:5909–5914  ·  view source on GitHub ↗

Register a hook to be called after a command is completed, whether it completes successfully or not.

(
        self, func: Callable[[plugin.CommandFinalizationData], plugin.CommandFinalizationData]
    )

Source from the content-addressed store, hash-verified

5907 raise TypeError(f"{func.__name__} must declare return a return type of {plugin.CommandFinalizationData}")
5908
5909 def register_cmdfinalization_hook(
5910 self, func: Callable[[plugin.CommandFinalizationData], plugin.CommandFinalizationData]
5911 ) -> None:
5912 """Register a hook to be called after a command is completed, whether it completes successfully or not."""
5913 self._validate_cmdfinalization_callable(func)
5914 self._cmdfinalization_hooks.append(func)
5915
5916 def _resolve_func_self(
5917 self,

Calls 2

appendMethod · 0.80