Viewing File: /usr/lib/python2.7/site-packages/enum/enum.pyo

ó
pvTc@sdZddlZdddgZdddfZed	ejd
 ƒZyeWne	k
rkd„ZnXyddl
mZWnek
r™e
ZnXyeWne	k
r»eZnXyeWne	k
rÝeZnXd
efd„ƒYZd„Zd„Zd„Zd„Zdefd„ƒYZe
Zdefd„ƒYZiZded<d„Zeed<[d„Zeed<[d„Zeed<[d„Z e ed <[ d!„Z!e!ed"<[!ed#kríd$„Z"e"ed%<["nXd&„Z#e#ed'<[#d(„Z$e$ed)<[$d*„Z%e%ed+<[%d,„Z&e&ed-<[&d.„Z'e'ed/<['d0„Z(e(ed1<[(d2„Z)e)ed3<[)d4„Z*e*ed5<[*ed6„ƒZ+e+ed7<[+ed8„ƒZ,e,ed9<[,edefeƒZ[de-efd:„ƒYZ.d;„Z/dS(<sPython EnumerationsiÿÿÿÿNtEnumtIntEnumtuniqueiiis%s.%sicCsx|D]}|rtSqWtS(N(tTruetFalse(titerabletelement((s-/usr/lib/python2.7/site-packages/enum/enum.pytanys
(tOrderedDictt_RouteClassAttributeToGetattrcBs8eZdZdd„Zdd„Zd„Zd„ZRS(sjRoute attribute access on a class to __getattr__.

    This is a descriptor, used to define attributes that act differently when
    accessed through an instance and through a class.  Instance access remains
    normal, but access to an attribute through a class will be routed to the
    class's __getattr__ method; this is done by raising AttributeError.

    cCs
||_dS(N(tfget(tselfR
((s-/usr/lib/python2.7/site-packages/enum/enum.pyt__init__/scCs%|dkrtƒ‚n|j|ƒS(N(tNonetAttributeErrorR
(Rtinstancet
ownerclass((s-/usr/lib/python2.7/site-packages/enum/enum.pyt__get__2scCstdƒ‚dS(Nscan't set attribute(R(RRtvalue((s-/usr/lib/python2.7/site-packages/enum/enum.pyt__set__7scCstdƒ‚dS(Nscan't delete attribute(R(RR((s-/usr/lib/python2.7/site-packages/enum/enum.pyt
__delete__:sN(t__name__t
__module__t__doc__R
RRRR(((s-/usr/lib/python2.7/site-packages/enum/enum.pyR	&s
	cCs+t|dƒp*t|dƒp*t|dƒS(s5Returns True if obj is a descriptor, False otherwise.RRR(thasattr(tobj((s-/usr/lib/python2.7/site-packages/enum/enum.pyt_is_descriptor>scCsZ|d |dkodknoY|dd!dkoY|dd!dkoYt|ƒdkS(s3Returns True if a __dunder__ name, False otherwise.iiþÿÿÿt__it_iýÿÿÿi(tlen(tname((s-/usr/lib/python2.7/site-packages/enum/enum.pyt
_is_dunderFs$cCsZ|d|dkodknoY|dd!dkoY|dd!dkoYt|ƒdkS(s1Returns True if a _sunder_ name, False otherwise.iiÿÿÿÿRiiiþÿÿÿ(R(R((s-/usr/lib/python2.7/site-packages/enum/enum.pyt
_is_sunderNs$cCs"dd„}||_d|_dS(s"Make the given class un-picklable.cSstd|ƒ‚dS(Ns%r cannot be pickled(t	TypeError(Rtprotocol((s-/usr/lib/python2.7/site-packages/enum/enum.pyt_break_on_call_reduceXss	<unknown>N(R
t
__reduce_ex__R(tclsR#((s-/usr/lib/python2.7/site-packages/enum/enum.pyt_make_class_unpicklableVs	t	_EnumDictcBs eZdZd„Zd„ZRS(s§Track enum member order and ensure member names are not reused.

    EnumMeta will use the names found in self._member_names as the
    enumeration member names.

    cCs tt|ƒjƒg|_dS(N(tsuperR'Rt
_member_names(R((s-/usr/lib/python2.7/site-packages/enum/enum.pyRescCsÇtdkr|dkrdSt|ƒr7tdƒ‚nst|ƒrFnd||jkrhtd|ƒ‚nBt|ƒsª||kr—td||ƒ‚n|jj|ƒntt	|ƒj
||ƒdS(sChanges anything not dundered or not a descriptor.

        If a descriptor is added with the same name as an enum member, the name
        is removed from _member_names (this may leave a hole in the numerical
        sequence of values).

        If an enum member name is used twice, an error is raised; duplicate
        values are not checked for.

        Single underscore (sunder) names are reserved.

        Note:   in 3.x __order__ is simply discarded as a not necessary piece
                leftover from 2.x

        g@t	__order__Ns(_names_ are reserved for future Enum usesAttempted to reuse key: %rsKey already defined as: %r(tpyverR t
ValueErrorRR)R!RtappendR(R't__setitem__(RtkeyR((s-/usr/lib/python2.7/site-packages/enum/enum.pyR.is(RRRRR.(((s-/usr/lib/python2.7/site-packages/enum/enum.pyR'^s	tEnumMetacBsïeZdZed„ƒZd„Zdddd„Zd„Zd„Z	d„Z
ed„ƒZd„Z
d	„Zd
„Zd„Zd„Zd
„Zd„Zdddd„Zed„ƒZedkrÞed„ƒZned„ƒZRS(sMetaclass for EnumcCstƒS(N(R'(tmetaclsR%tbases((s-/usr/lib/python2.7/site-packages/enum/enum.pyt__prepare__’scsƒtˆƒtkrKˆ}tƒ‰x'|jƒD]\}}|ˆ|<q.Wn|j|ƒ\‰}|jˆˆ|ƒ\}}	}
t‡fd†ˆjDƒƒ}xˆjD]
}ˆ|=q§Wˆjdƒ}
|
dkr_t	dkrSy8gt
|jƒdd„ƒD]\}}|^qþ}
Wq\tk
rOgt
|jƒƒD]}|^q:}
q\Xq¼ˆj}
n]ˆd=t	dkr¼|
j
ddƒjƒ}
g|D]}||
kr‘|^q‘}|
|7}
nt|ƒtdgƒ@}|rútd	d
j|ƒfƒ‚ntt|ƒj|||ˆƒ}g|_tdk	r?tƒ|_n	i|_ˆ|_i|_|dkrr|j}nx_|
D]W}||}t|tƒs¤|f}n|}ˆtkrÂ|f}n|
sÐ|rú||ƒ}t|dƒs*||_q*n0|||Œ}t|dƒs*ˆ|Œ|_n|j}||_||_|j |ŒxI|jjƒD](\}}|j!|jkrb|}PqbqbW|jj"|ƒ||j|<y||j|<Wqytk
rÏqyXqyWt#}dˆkr-ˆt$k	r-d}t%‡fd†|Dƒƒs*t&|ƒt'}q*q-nx„d D]|}t(||ƒ}t(ˆ|dƒ}t(||dƒ}|ˆkr4||k	r4|dkr|rq4nt)|||ƒq4q4Wt	dkrît*|t+ƒr9t)|dt(t+dƒƒq9nKt	dkr9t*|t+ƒr9x*d!D]}t)||t(t+|ƒƒqWq9nt,dk	r|	ret)|d|j-dƒnt)|dt,j-dƒn|S("Nc3s|]}|ˆ|fVqdS(N((t.0tk(t	classdict(s-/usr/lib/python2.7/site-packages/enum/enum.pys	<genexpr>¦sR*g@R/cSs|dS(Ni((titem((s-/usr/lib/python2.7/site-packages/enum/enum.pyt<lambda>¯st,t tmrosInvalid enum member name(s): %ss, t_value_R$t__getnewargs_ex__t__getnewargs__t
__reduce__c3s|]}|ˆjkVqdS(N(t__dict__(R4tm(tmember_type(s-/usr/lib/python2.7/site-packages/enum/enum.pys	<genexpr>	st__repr__t__str__t
__format__gÍÌÌÌÌÌ@t__cmp__t__le__t__lt__t__gt__t__ge__t__eq__t__ne__t__hash__t__member_new__t__new__(R=s__getnewargs__s
__reduce_ex__s
__reduce__(s__repr__s__str__s
__format__s
__reduce_ex__(s__le__s__lt__s__gt__s__ge__s__eq__s__ne__s__hash__(.ttypetdictR'titemst_get_mixins_t
_find_new_R)tgetR
R+tsortedR!tkeystreplacetsplittsetR,tjoinR(R0ROt_member_names_Rt_member_map_t
_member_type_t_value2member_map_t
isinstancettupleRR<t_name_t__objclass__RRR-RtobjectRR&Rtgetattrtsetattrt
issubclasstintRR@(R1R%R2R6t
original_dictR5tvt
first_enumROtsave_newtuse_argstmembersRR*Rtaliasest
invalid_namest
enum_classtmember_nametargstenum_membertcanonical_membertunpicklabletmethodstclass_methodt
obj_methodtenum_methodtmethod((R6RBs-/usr/lib/python2.7/site-packages/enum/enum.pyRO–sÈ	8
,%
!				

			






#cCs8|dkr|j||ƒS|j||d|d|ƒS(s¯Either returns an existing member, or creates a new enum class.

        This method is used both when an enum class is given a value to match
        to an enumeration member (i.e. Color(3)) and for the functional API
        (i.e. Color = Enum('Color', names='red green blue')).

        When used for the functional API: `module`, if set, will be stored in
        the new class' __module__ attribute; `type`, if set, will be mixed in
        as the first base class.

        Note: if `module` is not set this routine will attempt to discover the
        calling module by walking the frame stack; if this is unsuccessful
        the resulting class will not be pickleable.

        tmoduleRPN(R
ROt_create_(R%RtnamesR|RP((s-/usr/lib/python2.7/site-packages/enum/enum.pyt__call__9scCst||ƒo|j|jkS(N(R`RR](R%tmember((s-/usr/lib/python2.7/site-packages/enum/enum.pyt__contains__NscCs?||jkr%td|jƒ‚ntt|ƒj|ƒdS(Ns%s: cannot delete Enum member.(R]RRR(R0t__delattr__(R%tattr((s-/usr/lib/python2.7/site-packages/enum/enum.pyR‚QscCsddddg|jS(Nt	__class__Rt__members__R(R\(R((s-/usr/lib/python2.7/site-packages/enum/enum.pyt__dir__YscCs
|jjƒS(s­Returns a mapping of member name->value.

        This mapping lists all enum members, including aliases. Note that this
        is a copy of the internal mapping.

        (R]tcopy(R%((s-/usr/lib/python2.7/site-packages/enum/enum.pyR…]scCsNt|ƒrt|ƒ‚ny|j|SWntk
rIt|ƒ‚nXdS(s5Return the enum member matching `name`

        We use __getattr__ instead of descriptors or inserting into the enum
        class' __dict__ in order to support `name` and `value` being both
        properties for enum members (which live in the class' __dict__) and
        enum members themselves.

        N(RRR]tKeyError(R%R((s-/usr/lib/python2.7/site-packages/enum/enum.pyt__getattr__gs	
cCs|j|S(N(R](R%R((s-/usr/lib/python2.7/site-packages/enum/enum.pyt__getitem__wscs‡fd†ˆjDƒS(Nc3s|]}ˆj|VqdS(N(R](R4R(R%(s-/usr/lib/python2.7/site-packages/enum/enum.pys	<genexpr>{s(R\(R%((R%s-/usr/lib/python2.7/site-packages/enum/enum.pyt__iter__zscs‡fd†tˆjƒDƒS(Nc3s|]}ˆj|VqdS(N(R](R4R(R%(s-/usr/lib/python2.7/site-packages/enum/enum.pys	<genexpr>~s(treversedR\(R%((R%s-/usr/lib/python2.7/site-packages/enum/enum.pyt__reversed__}scCs
t|jƒS(N(RR\(R%((s-/usr/lib/python2.7/site-packages/enum/enum.pyt__len__€scCsd|jS(Ns	<enum %r>(R(R%((s-/usr/lib/python2.7/site-packages/enum/enum.pyRCƒscCsM|jjdiƒ}||kr0tdƒ‚ntt|ƒj||ƒdS(sùBlock attempts to reassign Enum members.

        A simple assignment to the class namespace only changes one of the
        several possible ways to get an Enum member from the Enum class,
        resulting in an inconsistent Enumeration.

        R]sCannot reassign members.N(R@RURR(R0t__setattr__(R%RRt
member_map((s-/usr/lib/python2.7/site-packages/enum/enum.pyR†scCstdkrXt|tƒrXy|jdƒ}WqUtk
rQtd|ƒ‚qUXqXn|j}|dkry|f}n||f}|j||ƒ}g}t|t	ƒrÇ|j
ddƒjƒ}nt|tt
fƒr!t|dt	ƒr!gt|ƒD]\}	}
|
|	df^qü}nxT|D]L}t|t	ƒrQ|||}}
n|\}}
|
||<|j|ƒq(Wt|t	ƒsdj|ƒ|d<n|j||||ƒ}|dkrøytjd	ƒjd
}Wqøttfk
rôqøXn|dkrt|ƒn	||_|S(s}Convenience method to create a new Enum class.

        `names` can be:

        * A string containing member names, separated either with spaces or
          commas.  Values are auto-numbered from 1.
        * An iterable of member names.  Values are auto-numbered from 1.
        * An iterable of (member name, value) pairs.
        * A mapping of member name -> value.

        g@tasciis %r is not representable in ASCIIR9R:iiR*iRN(R+R`tunicodetencodetUnicodeEncodeErrorR!R„R
R3t
basestringRXRYRatlistt	enumerateR-R[ROt_syst	_getframet	f_globalsRR,R&R(R%t
class_nameR~R|RPR1R2R6R*titeR7Rrtmember_valueRq((s-/usr/lib/python2.7/site-packages/enum/enum.pyR}“sD
	(2


	cCs|stdkrttfSd}}xA|D]9}|tk	r.t|tƒr.|jr.tdƒ‚q.q.Wt|tƒs‰tdƒ‚nt|dtƒs³|d}|d}nTxQ|djD]B}t|tƒrî|dkr|}qqÁ|dkrÁ|}qÁqÁW||fS(sžReturns the type for creating enum members, and the first inherited
        enum class.

        bases: the tuple of bases that was given to __new__

        sCannot extend enumerationssHnew enumerations must be created as `ClassName([mixin_type,] enum_type)`iiÿÿÿÿN(RR
RdRgR\R!t__mro__(R2RBRktbase((s-/usr/lib/python2.7/site-packages/enum/enum.pyRSÏs(


	


g@cCst|jddƒ}|r%dttfStddƒ}ttdƒ}tdkrX|}n
tjd}xádD]Ð}x·||fD]©}y|j|}	Wn)ttfk
rÁt||dƒ}	nX|	d|||gkr|dkrý|	|d<dt	tfSt
|	tƒr|	j|ƒ}	n|	}PqqW|dk	rlPqlqlWtj
}|tj
krat	}
nt}
|t	|
fS(sReturns the __new__ to be used for creating the enum members.

            classdict: the class dictionary given to __new__
            member_type: the data type whose __new__ will be used by default
            first_enum: enumeration to check for an overriding __new__

            RORNN(s__member_new__s__new__(RUR
RReRdRR@RRˆRR`tstaticmethodRRO(R6RBRkROtN__new__tO__new__tE__new__R{tpossiblettargetRm((s-/usr/lib/python2.7/site-packages/enum/enum.pyRTþsB
	



		c	CsÖ|jddƒ}|dk	}|dkr«x~dD]j}xQ||fD]C}t||dƒ}|ddjtjtjfkrD|}PqDqDW|dk	r1Pq1q1Wtj}n|tjkrÃt}nt}|||fS(sReturns the __new__ to be used for creating the enum members.

            classdict: the class dictionary given to __new__
            member_type: the data type whose __new__ will be used by default
            first_enum: enumeration to check for an overriding __new__

            RORNN(s__member_new__s__new__(RUR
ReRORdRRR(	R6RBRkRORlR{R¥R¦Rm((s-/usr/lib/python2.7/site-packages/enum/enum.pyRT8s(
	N(RRRtclassmethodR3ROR
RRR‚R†tpropertyR…R‰RŠR‹RRŽRCRR}R¡RSR+RT(((s-/usr/lib/python2.7/site-packages/enum/enum.pyR0s(	£			
							
<.:sNGeneric enumeration.

    Derive from this class to define new enumerations.

RcCsšt|ƒ|kr|j}ny||jkr;|j|SWn>tk
r|x.|jjƒD]}|j|kr\|Sq\WnXtd||jfƒ‚dS(Ns%s is not a valid %s(RPRR_R!R]tvaluesR,R(R%RR€((s-/usr/lib/python2.7/site-packages/enum/enum.pyROps
ROcCsd|jj|j|jfS(Ns<%s.%s: %r>(R„RRbR<(R((s-/usr/lib/python2.7/site-packages/enum/enum.pyRC†sRCcCsd|jj|jfS(Ns%s.%s(R„RRb(R((s-/usr/lib/python2.7/site-packages/enum/enum.pyRDŒsRDcCsSg|jjƒD],}|jD]}|ddkr|^qq}dddg|S(NiRR„RR(R„R;R@(RR%RAtadded_behavior((s-/usr/lib/python2.7/site-packages/enum/enum.pyR†‘s

R†cCsF|jtkr$t}t|ƒ}n|j}|j}|j||ƒS(N(R^RdtstrRRE(Rtformat_specR%tval((s-/usr/lib/python2.7/site-packages/enum/enum.pyREœs		REgÍÌÌÌÌÌ@cCsUt|ƒ|jkr/||kr(dSndSntStd|jj|jjfƒ‚(Niiÿÿÿÿs unorderable types: %s() and %s()(RPR„tNotImplementedR!R(Rtother((s-/usr/lib/python2.7/site-packages/enum/enum.pyRF³sRFcCs&td|jj|jjfƒ‚dS(Nsunorderable types: %s() <= %s()(R!R„R(RR¯((s-/usr/lib/python2.7/site-packages/enum/enum.pyRG¿sRGcCs&td|jj|jjfƒ‚dS(Nsunorderable types: %s() < %s()(R!R„R(RR¯((s-/usr/lib/python2.7/site-packages/enum/enum.pyRHÄsRHcCs&td|jj|jjfƒ‚dS(Nsunorderable types: %s() >= %s()(R!R„R(RR¯((s-/usr/lib/python2.7/site-packages/enum/enum.pyRJÉsRJcCs&td|jj|jjfƒ‚dS(Nsunorderable types: %s() > %s()(R!R„R(RR¯((s-/usr/lib/python2.7/site-packages/enum/enum.pyRIÎsRIcCs#t|ƒ|jkr||kStS(N(RPR„R®(RR¯((s-/usr/lib/python2.7/site-packages/enum/enum.pyRKÔs
RKcCs#t|ƒ|jkr||k	StS(N(RPR„R®(RR¯((s-/usr/lib/python2.7/site-packages/enum/enum.pyRLÛs
RLcCs
t|jƒS(N(thashRb(R((s-/usr/lib/python2.7/site-packages/enum/enum.pyRMâsRMcCs|j|jffS(N(R„R<(Rtproto((s-/usr/lib/python2.7/site-packages/enum/enum.pyR$çsR$cCs|jS(N(Rb(R((s-/usr/lib/python2.7/site-packages/enum/enum.pyRósRcCs|jS(N(R<(R((s-/usr/lib/python2.7/site-packages/enum/enum.pyRùsRcBseZdZRS(s.Enum where members are also (and must be) ints(RRR(((s-/usr/lib/python2.7/site-packages/enum/enum.pyRscCs£g}xE|jjƒD]4\}}||jkr|j||jfƒqqW|rŸdjg|D]\}}d||f^qaƒ}td||fƒ‚n|S(sIClass decorator that ensures only unique members exist in an enumeration.s, s%s -> %ssduplicate names found in %r: %s(R…RRRR-R[R,(tenumerationt
duplicatesRR€taliastduplicate_names((s-/usr/lib/python2.7/site-packages/enum/enum.pyR	s,(0RtsysR˜t__all__tversiontfloattversion_infoR+Rt	NameErrortcollectionsRtImportErrorR
R•R«R’RdR	RRR R&RQR'RRPR0ttemp_enum_dictRORCRDR†RERFRGRHRJRIRKRLRMR$RRRhRR(((s-/usr/lib/python2.7/site-packages/enum/enum.pyt<module>s¨







				/ÿÞ
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	


Back to Directory File Manager