Action level enumeration types.
Classes
|
Action level enumeration type for events. |
|
Helper class for keeping track of per-purpose forbidden actions. |
Exceptions
|
Error raised for unknown or disallowed action arguments. |
Bases: Enum
Action level enumeration type for events.
Types that may be interpreted as an ActionLevel.
alias of Union[Literal[‘ignore’, ‘warn’, ‘raise’, ‘IGNORE’, ‘WARN’, ‘RAISE’], ActionLevel]
Raise an error.
Raise a warning
Ignore the event.
Verify an action level.
action – The value to verify.
purpose – Additional information to add if an exception is raised.
forbidden – Which of (‘ignore’, ‘warn’, ‘raise’) not to accept. Accept all if None.
A valid action level for the given purpose.
BadActionLevelError – If action is not in (‘ignore’, ‘warn’, ‘raise’) or if action is in remove.
Bases: object
Helper class for keeping track of per-purpose forbidden actions.
require_purpose – Determine how to handle the purpose argument given in verify(); require that it exists,
or just that it is given. Must be one of (‘given’, ‘exists’).
**forbidden_for_purpose – Per-purpose forbidden actions.
Verify an action level with constraints.
action – The value to verify.
purpose – Additional information to add if an exception is raised.
A valid action level for the given purpose.
BadActionLevelError – If action is not in (‘ignore’, ‘warn’, ‘raise’) or if action is in remove.
ValueError – If purpose is unknown and require_purpose is set to ‘exists’.
Bases: ValueError
Error raised for unknown or disallowed action arguments.