def __init__(self, depends_on, length, correction=None, encoder=ENC_INT_DEFAULT, fuzzable=False, name=None):
'''
:param depends_on: (name of) field we depend on
:param length: length of the FieldIntProperty field (in bits)
:type corrention: int or func(int) -> int
:param correction: correction function, or value for the index
:type encoder: :class:`~kitty.model.low_level.encoder.BitFieldEncoder`
:param encoder: encoder for the field (default: ENC_INT_DEFAULT)
:param fuzzable: is container fuzzable
:param name: (unique) name of the container (default: None)
'''
if correction:
if not callable(correction):
if not isinstance(correction, types.IntType):
raise KittyException('correction must be int, function or None!')
self._correction = correction
bit_field = BitField(value=0, length=length, encoder=encoder)
super(FieldIntProperty, self).__init__(depends_on=depends_on, bit_field=bit_field, calc_func=None, fuzzable=fuzzable, name=name)
self.dependency_type = Calculated.FIELD_PROP_BASED
评论列表
文章目录