xml.py 文件源码

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

项目:isf 作者: w3h 项目源码 文件源码
def __init__(self, name, attribute, value, fuzz_attribute=False, fuzz_value=True):
        '''
        :param name: name of the block
        :param attribute: attribute
        :type value: str/unicode/int
        :param value: value of the attribute
        :param fuzz_attribute: should we fuzz the attribute field (default: False)
        :param fuzz_value: should we fuzz the value field (default: True)
        '''
        _check_type(attribute, StringTypes, 'attribute')
        _check_type(value, StringTypes + (IntType, ), 'value')

        value_name = _valuename(name)
        if isinstance(value, StringTypes):
            value_field = String(value, name=value_name, fuzzable=fuzz_value)
        else:
            value_field = SInt32(value, encoder=ENC_INT_DEC, fuzzable=fuzz_value, name=value_name)
        fields = [
            String(attribute, fuzzable=fuzz_attribute, name='%s_attribute' % name),
            Static('='),
            Static('"'),
            value_field,
            Static('"')
        ]
        super(XmlAttribute, self).__init__(fields, name=name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号