calculated.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:kitty 作者: cisco-sas 项目源码 文件源码
def __init__(self, depends_on, func, encoder=ENC_STR_DEFAULT, fuzzable=False, name=None):
        '''
        :param depends_on: (name of) field we depend on
        :param func: function for processing of the dependant data. func(str)->str
        :type encoder: :class:`~kitty.model.low_level.encoder.StrEncoder`
        :param encoder: encoder for the field (default: ENC_STR_DEFAULT)
        :param fuzzable: is container fuzzable
        :param name: (unique) name of the container
        '''
        try:
            res = func('')
            kassert.is_of_types(res, types.StringTypes)
            self._func = func
        except:
            raise KittyException('func should be func(str)->str')
        super(CalculatedStr, self).__init__(depends_on=depends_on, encoder=encoder, fuzzable=fuzzable, name=name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号