ó #ßøTc@s|ddlmZddlmZmZddlZddlZddlZdefd„ƒYZ ej ee e ƒe _ dS(iÿÿÿÿ(t _allow_facet(tEmptyIt ImmutableDictNtFacetscBsšeZdZdZdZed„Zed)d„ƒZ ed)d„ƒZ d„Z d„Z d„Z d „Zd „Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zed„Zd„Zd„Zd„Zed„Zd„Zd„Zd„Zd„Z d„Z!d„Z"d)d„Z#d„Z$d„Z%d „Z&d!„Z'd"„Z(d#„Z)d$„Z*d%„Z+d&„Z,e-d'„ƒZ.e-d(„ƒZ/RS(*tsystemtlocaltparentcCsTtj|ƒg|_i|_i|_d|_i|_d|_|j |ƒdS(N( tdictt__init__t_Facets__keylistt _Facets__rest_Facets__localtNonet_Facets__local_rot_Facets__inheritedt_Facets__inherited_rotupdate(tselftinit((s//usr/lib/python2.7/vendor-packages/pkg/facet.pyR\s       cCs^g|jjƒD]\}}||tg^qg|jjƒD]\}}||tg^q>S(sReturns the serialized state of this object in a format that that can be easily stored using JSON, pickle, etc.(Rt iteritemstTrueR tFalse(tobjtje_statetktv((s//usr/lib/python2.7/vendor-packages/pkg/facet.pytgetstatehs+cCsJtƒ}x:|D]2\}}}|s2|||(tjoinR Rt __getitem__(RtsR((s//usr/lib/python2.7/vendor-packages/pkg/facet.pyt__repr__×s  3 cCsd„}g|_|jtg|D]}||jkr#|^q#d|ƒ7_|jtg|D]}||jkr`|^q`d|ƒ7_dS(s{Update __keysort, which is used to determine facet matching order. Inherited facets always take priority over local facets so make sure all inherited facets come before local facets in __keylist. All facets from a given source are sorted by length, and facets of equal length are sorted lexically.cSs3t|ƒt|ƒ}|dkr&|St||ƒS(Ni(tlenR#(txtyti((s//usr/lib/python2.7/vendor-packages/pkg/facet.pyt facet_sortés R#N(R tsortedR(RR9R8((s//usr/lib/python2.7/vendor-packages/pkg/facet.pyt__keylist_sortás       cCs |jdƒstd‚n|tkp0|tks?td‚nt}|rZ||jksm| rv||krvt}n|r•||j|, ) where key is the explicitly set facet name (which may be a glob pattern) that matched the caller specific facet name.sfacet.skey must start w/ facet.s facet.debug.sfacet.optional.N( R<R=RR2R R tmatchR RR(RRER((s//usr/lib/python2.7/vendor-packages/pkg/facet.pyt__getitem_internals    cCs|j|ƒdS(Ni(t_Facets__getitem_internal(RRE((s//usr/lib/python2.7/vendor-packages/pkg/facet.pyR26scCsCtj||ƒst|‚n| r@||jkr@t|‚n| s\||jks\t‚t}|r¹||jkr¹tj|||j|ƒtj t j |ƒƒ|j |, , ) which represent all currently set values for this facet.(RtFACET_SRC_PARENTRtappendR tFACET_SRC_LOCALR(RtnameRtsrcRFtmasked((s//usr/lib/python2.7/vendor-packages/pkg/facet.pyt _src_valuesÁs     cCsg|jƒD] }|^q S(N(R(RRZ((s//usr/lib/python2.7/vendor-packages/pkg/facet.pytitemsØsccs'x |jD]}|||fVq WdS(N(R (RR((s//usr/lib/python2.7/vendor-packages/pkg/facet.pyRÛscCs t|ƒS(N(R(R((s//usr/lib/python2.7/vendor-packages/pkg/facet.pytcopyßscCsGg|_i|_i|_d|_i|_d|_tj|ƒdS(N( R R R R R RRRtclear(R((s//usr/lib/python2.7/vendor-packages/pkg/facet.pyRpâs      cCsd|j|ƒd}||jkr)|jS||jkr?|jS|dkrW||ks]t‚|jS(sReport the source of a facet value if we were to attempt to look it up in the current Facets object dictionary.iN(RMRRgR RiR R"tFACET_SRC_SYSTEM(RRjR((s//usr/lib/python2.7/vendor-packages/pkg/facet.pyt _match_srcëscCs+|jdkr$t|jƒ|_n|jS(N(R R RR (R((s//usr/lib/python2.7/vendor-packages/pkg/facet.pyRùscCs+|jdkr$t|jƒ|_n|jS(N(RR RR(R((s//usr/lib/python2.7/vendor-packages/pkg/facet.pyRGÿsN(0t__name__t __module__RqRiRgRRt staticmethodR RR R%R'R(R&R)R*R+R,R-R.R4RDRRJR?RMR2RRRORRTR^RbRcRdRRSRfRmRnRRoRpRrtpropertyRRG(((s//usr/lib/python2.7/vendor-packages/pkg/facet.pyR#sV5    "            )             ( t pkg._varcetRtpkg.miscRRRBR@ttypesRRt MethodTypeR t allow_action(((s//usr/lib/python2.7/vendor-packages/pkg/facet.pyts   ÿä