yawning_titan.config.item_types.int_item#
Classes
An int config item type. |
|
The IntProperties class holds the properties relevant for defining and validating an int value. |
|
Integer parity. |
- class yawning_titan.config.item_types.int_item.Parity(value)[source]#
Integer parity.
- ODD = 1#
- EVEN = 2#
- class yawning_titan.config.item_types.int_item.IntProperties(_allowed_types=None, allow_null=None, default=None, min_val=None, inclusive_min=None, max_val=None, inclusive_max=None, parity=None)[source]#
The IntProperties class holds the properties relevant for defining and validating an int value.
- min_val = None#
A minimum int value.
- inclusive_min = None#
Indicates whether min_val is exclusive of the value (>=, rather than >).
- max_val = None#
A maximum int value.
- inclusive_max = None#
Indicates whether max_val is exclusive of the value (<=, rather than <).
- parity = None#
The integer parity.
- allow_null = None#
True if the config value can be left empty, otherwise False.
- __init__(_allowed_types=None, allow_null=None, default=None, min_val=None, inclusive_min=None, max_val=None, inclusive_max=None, parity=None)#
- default = None#
The default value
- to_dict()[source]#
Serializes the
IntProperties
as a dict.- Returns:
The
IntProperties
as a dict.
- validate(val)[source]#
Validates an int against the properties set in
IntProperties
.- Parameters:
val – A int to be validated.
- Returns:
An instance of
ConfigItemValidation
.- Raise:
ConfigItemValidationError
when validation fails.