argclz.dispatch.core.DispatchGroup#
- class argclz.dispatch.core.DispatchGroup[source]#
Bases:
NamedTupledispatch group.
- __init__()#
Methods Summary
__init__()__call__(command, *alias[, order, usage, hidden])A decorator that mark a function as a dispatch target function.
__get__(instance, owner)Attributes Summary
group name
Details
- __call__(command, *alias, order=5, usage=None, hidden=False)[source]#
A decorator that mark a function as a dispatch target function.
All functions decorated in same dispatch group should have save function signature (at least for non-default parameters). For example:
Example
>>> class D(Dispatch): ... command_group = dispatch_group('A') ... @command_group('A') ... def function_a(self, a, b, c=None): ... pass
- Parameters:
command (str) – primary command name
alias (str) – secondary command names
order (float) – order of this command shown in the
build_command_usages()usage (str | None) – usage line of this command shown in the
build_command_usages()hidden – hide this command from
list_commands()