Your IP : 216.73.216.213


Current Path : /opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyc

�
�b�Nc@sddlZddlmZddd��YZdefd��YZdefd��YZd	efd
��YZdefd��YZd
efd��YZdefd��YZ	defd��YZ
defd��YZdefd��YZdefd��YZ
dS(i����N(terrortAbstractConstraintcBs�eZdZd�Zdd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Ze
jd
dkrd�Zn	d
�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(s�Abstract base-class for constraint objects

       Constraints should be stored in a simple sequence in the
       namespace of their client Asn1Item sub-classes.
    cGs#i|_|j|�d|_dS(N(t	_valueMapt
_setValuestNonet!_AbstractConstraint__hashedValues(tselftvalues((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyt__init__s	
cCsRy|j||�Wn7tjk
rMtjd|tj�df��nXdS(Ns%s failed at: "%s"i(t
_testValueRtValueConstraintErrortsystexc_info(Rtvaluetidx((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyt__call__s
cCs9d|jjdjg|jD]}t|�^q�fS(Ns%s(%s)s, (t	__class__t__name__tjoint_valuestrepr(Rtx((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyt__repr__"s	cCs||krtp|j|kS(N(tTrueR(Rtother((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyt__eq__'scCs
|j|kS(N(R(RR((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyt__ne__)tcCs
|j|kS(N(R(RR((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyt__lt__*RcCs
|j|kS(N(R(RR((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyt__le__+RcCs
|j|kS(N(R(RR((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyt__gt__,RcCs
|j|kS(N(R(RR((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyt__ge__-RiicCs
t|j�S(N(tboolR(R((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyt__nonzero__/RcCs
t|j�S(N(R R(R((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyt__bool__1RcCs7|jdkr0t|jj|jf�|_n|jS(N(RRthashRRR(R((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyt__hash__3s!cCs
||_dS(N(R(RR((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR8RcCstj|��dS(N(RR
(RR
R((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR	9scCs|jS(N(R(R((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pytgetValueMap=RcCs(||j�kp'||kp'||kS(N(R%(RtotherConstraint((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyt
isSuperTypeOf>scCs%||jkp$||kp$||kS(N(R(RR&((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pytisSubTypeOfAsN(Rt
__module__t__doc__RRRRRRRRRRRtversion_infoR!R"R$RR	R%R'R((((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyRs&														tSingleValueConstraintcBseZdZd�ZRS(s/Value must be part of defined values constraintcCs%||jkr!tj|��ndS(N(RRR
(RR
R((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR	Gs(RR)R*R	(((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR,EstContainedSubtypeConstraintcBseZdZd�ZRS(s4Value must satisfy all of defined set of constraintscCs%x|jD]}|||�q
WdS(N(R(RR
Rtc((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR	Ns(RR)R*R	(((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR-LstValueRangeConstraintcBs eZdZd�Zd�ZRS(s6Value must be within start and stop values (inclusive)cCs4||jks||jkr0tj|��ndS(N(tstarttstopRR
(RR
R((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR	TscCs�t|�dkr1tjd|jjf��n|\|_|_|j|jkr�tjd|jj|j|jf��ntj||�dS(Nis%s: bad constraint valuess5%s: screwed constraint values (start > stop): %s > %s(	tlenRtPyAsn1ErrorRRR0R1RR(RR((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyRXs	(RR)R*R	R(((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR/Rs	tValueSizeConstraintcBseZdZd�ZRS(s;len(value) must be within start and stop values (inclusive)cCs@t|�}||jks*||jkr<tj|��ndS(N(R2R0R1RR
(RR
Rtl((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR	is(RR)R*R	(((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR4gstPermittedAlphabetConstraintcBseZd�Zd�ZRS(cCs4d|_x$|D]}|jt|�|_qWdS(N((Rttuple(RRtv((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyRos	
cCs6x/|D]'}||jkrtj|��qqWdS(N(RRR
(RR
RR8((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR	ts
(RR)RR	(((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR6ns	tInnerTypeConstraintcBs eZdZd�Zd�ZRS(s0Value must satisfy type and presense constraintscCs�|jr|j|�nh|jr�||jkrCtj|��n|j|\}}|dkrttj|��n||�ndS(NtABSENT(t*_InnerTypeConstraint__singleTypeConstraintt,_InnerTypeConstraint__multipleTypeConstraintRR
(RR
Rt
constrainttstatus((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR	|s		cCsqi|_d|_xH|D]@}t|t�rP|d|df|j|d<q||_qWtj||�dS(Niii(R<RR;t
isinstanceR7RR(RRR8((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR�s		
"
(RR)R*R	R(((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR9zs	tConstraintsExclusioncBs eZdZd�Zd�ZRS(s(Value must not fit the single constraintcCsCy|jd||�Wntjk
r/dSXtj|��dS(Ni(RRR
(RR
R((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR	�s
cCs8t|�dkr$tjd��ntj||�dS(NisSingle constraint expected(R2RR3RR(RR((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR�s(RR)R*R	R(((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR@�s	tAbstractConstraintSetcBs;eZdZd�Zd�Zd�Zd�Zd�ZRS(s,Value must not satisfy the single constraintcCs|j|S(N(R(RR((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyt__getitem__�RcCs|j||�S(N(R(RR
((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyt__add__�RcCs|j||�S(N(R(RR
((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyt__radd__�RcCs
t|j�S(N(R2R(R((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyt__len__�RcCsA||_x1|D])}d|j|<|jj|j��qWdS(Ni(RRtupdateR%(RRR8((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR�s	

(RR)R*RBRCRDRER(((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyRA�s				tConstraintsIntersectioncBseZdZd�ZRS(s"Value must satisfy all constraintscCs%x|jD]}|||�q
WdS(N(R(RR
RR8((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR	�s(RR)R*R	(((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyRG�stConstraintsUnioncBseZdZd�ZRS(s*Value must satisfy at least one constraintcCs`x=|jD]2}y|||�Wntjk
r7q
XdSq
Wtjd|j|f��dS(Nsall of %s failed for "%s"(RRR
(RR
RR8((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyR	�s(RR)R*R	(((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyRH�s((Rtpyasn1.typeRRR,R-R/R4R6R9R@RARGRH(((sG/opt/alt/python27/lib/python2.7/site-packages/pyasn1/type/constraint.pyt<module>s4