duty ¤
duty package.
A simple task runner.
Modules:
-
callables
–Module containing callables for many tools.
-
cli
–Module that contains the command line application.
-
collection
–Module containing all the logic.
-
context
–Module containing the context definition.
-
debug
–Debugging utilities.
-
decorator
–Module containing the decorator provided to users.
-
exceptions
–Module containing the project's exceptions.
-
validation
–This module contains logic used to validate parameters passed to duties.
Functions:
-
duty
–Decorate a callable to transform it and register it as a duty.
duty ¤
Decorate a callable to transform it and register it as a duty.
Parameters:
Raises:
-
ValueError
–When the decorator is misused.
Examples:
Decorate a function:
@duty
def clean(ctx):
ctx.run("rm -rf build", silent=True)
Pass options to the context:
@duty(silent=True)
def clean(ctx):
ctx.run("rm -rf build") # silent=True is implied
Returns:
Source code in src/duty/decorator.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
|