katnip.legos.dynamic module¶
Extensions for the DynamicField, allowing advanced mutations on dynamic fields.
-
class
katnip.legos.dynamic.
DynamicExtended
(key, value, additional_field, fuzzable=True, name=None)¶ Bases:
kitty.model.low_level.container.OneOf
Container that provides mutations based on the dynamic value, or based on the other given field.
-
__init__
(key, value, additional_field, fuzzable=True, name=None)¶ Parameters: - key – key for data in the session information
- value – the default value of the Dynamic field
- additional_field – the additional field to base the mutations on
- fuzzable – is this field fuzzable (default: False)
- name – name of the container (default: None)
-
-
class
katnip.legos.dynamic.
DynamicInt
(key, bitfield, fuzzable=True, name=None)¶ Bases:
katnip.legos.dynamic.DynamicExtended
Container that provides mutations based on the dynamic value, or based on BitField mutations.
-
__init__
(key, bitfield, fuzzable=True, name=None)¶ Parameters: - key – key for data in the session information
- bitfield – a bitfield to base the value on
- fuzzable – (default: True)
- name – (default: None)
-
-
class
katnip.legos.dynamic.
DynamicString
(key, value, keep_size=False, encoder=<kitty.model.low_level.encoder.StrEncoder object>, fuzzable=True, name=None)¶ Bases:
katnip.legos.dynamic.DynamicExtended
Container that provides mutations based on the dynamic value, or based on string mutations.
-
__init__
(key, value, keep_size=False, encoder=<kitty.model.low_level.encoder.StrEncoder object>, fuzzable=True, name=None)¶ Parameters: - key – key for data in the session information
- value – the default value of the Dynamic field
- keep_size – should limit the size of the string based on the original string (default: False)
- encoder – string encoder (default:
ENC_STR_DEFAULT
) - fuzzable – is this field fuzzable (default: True)
- name – name of the container (default: None)
-