woob.tools.value
¶
- class ValuesDict(*values)[source]¶
Bases:
OrderedDict
Ordered dictionary which can take values in constructor.
>>> ValuesDict(Value('a', label='Test'), ValueInt('b', label='Test2'))
- with_values_from(other)[source]¶
Get a copy of the object, with overrides from another values dictionary.
Values from the other dictionary will override values from the current dictionary.
- Parameters:
other (
ValuesDict
) – the other dictionary to take values from.- Return type:
TypeVar
(ValuesDictType
, bound= ValuesDict)- Returns:
The new values dictionary.
- class Value(*args, **kwargs)[source]¶
Bases:
object
Value.
- Parameters:
label (str) – human readable description of a value
required (bool) – if
True
, the backend can’t load if the key isn’t found in its configurationdefault – an optional default value, used when the key is not in config. If there is no default value and the key is not found in configuration, the required parameter is implicitly set
masked (bool) – if
True
, the value is masked. It is useful for applications to know if this key is a passwordregexp (str) – if specified, on load the specified value is checked against this regexp, and an error is raised if it doesn’t match
choices ((list,dict)) – if this parameter is set, the value must be in the list
aliases (dict) – mapping of old choices values that should be accepted but not presented
tiny (bool) – the value of choices can be entered by an user (as they are small)
transient (bool) – this value is not persistent (asked only if needed)
- class ValueBackendPassword(*args, **kwargs)[source]¶
Bases:
Value