Python pyasn1.type.constraint 模块,ValueRangeConstraint() 实例源码

我们从Python开源项目中,提取了以下6个代码示例,用于说明如何使用pyasn1.type.constraint.ValueRangeConstraint()

项目:PiBunny    作者:tholum    | 项目源码 | 文件源码
def _vno_component(tag_value, name="pvno"):
    return _sequence_component(
        name, tag_value, univ.Integer(),
        subtypeSpec=constraint.ValueRangeConstraint(5, 5))
项目:pysnmp    作者:etingof    | 项目源码 | 文件源码
def withRange(cls, minimum, maximum):
        """Creates a subclass with value range constraint.
        """

        class X(cls):
            subtypeSpec = cls.subtypeSpec + constraint.ValueRangeConstraint(minimum, maximum)

        X.__name__ = cls.__name__
        return X
项目:CVE-2017-7494    作者:joxeankoret    | 项目源码 | 文件源码
def _vno_component(tag_value, name="pvno"):
    return _sequence_component(
        name, tag_value, univ.Integer(),
        subtypeSpec=constraint.ValueRangeConstraint(5, 5))
项目:kekescan    作者:xiaoxiaoleo    | 项目源码 | 文件源码
def withRange(cls, minimum, maximum):
        """Creates a subclass with value range constraint.
        """
        class X(cls):
            subtypeSpec = cls.subtypeSpec + constraint.ValueRangeConstraint(minimum, maximum)
        X.__name__ = cls.__name__
        return X
项目:kekescan    作者:xiaoxiaoleo    | 项目源码 | 文件源码
def _vno_component(tag_value, name="pvno"):
    return _sequence_component(
        name, tag_value, univ.Integer(),
        subtypeSpec=constraint.ValueRangeConstraint(5, 5))
项目:PyQYT    作者:collinsctk    | 项目源码 | 文件源码
def withRange(cls, minimum, maximum):
        """Creates a subclass with value range constraint.
        """
        class X(cls):
            subtypeSpec = cls.subtypeSpec + constraint.ValueRangeConstraint(minimum, maximum)
        X.__name__ = cls.__name__
        return X