Ñò ž²Hc @sdZddkZddkZyddkZWnej oddkZnXddklZdddgZdZ hZ ei ƒZ ei iei ieƒdƒZd „Zd „Zed „Zd „Zd efd„ƒYZdeefd„ƒYZdS(s¬Low-level locale data access. :note: The `Locale` class, which uses this module under the hood, provides a more convenient interface for accessing the locale data. iÿÿÿÿN(t DictMixintexiststlisttloadsrestructuredtext ent localedatacCs5|tjotStiitiitd|ƒƒS(sÈCheck whether locale data is available for the given locale. :param name: the locale identifier string :return: `True` if the locale data exists, `False` otherwise :rtype: `bool` s%s.dat(t_cachetTruetostpathRtjoint_dirname(tname((s4/usr/lib/python2.6/site-packages/babel/localedata.pyR$s cCssg}g}titƒD]}|tii|ƒq~D]1\}}|djo|djo ||q;q;~S(sºReturn a list of all locale identifiers for which locale data is available. :return: a list of locale identifiers (strings) :rtype: `list` :since: version 0.8.1 s.dattroot(RtlistdirR Rtsplitext(t_[1]t_[2]tfilenametstemt extension((s4/usr/lib/python2.6/site-packages/babel/localedata.pyR0s@c Cs/tiƒzti|ƒ}|põ|djp| o h}nR|idƒ}t|ƒdjo d}ndi|d ƒ}t|ƒiƒ}t i it d|ƒ}t |dƒ}zK|djo!|ot |ti|ƒƒnti|ƒ}|t|>> d = load('en_US') >>> d['languages']['sv'] u'Swedish' Note that the results are cached, and subsequent requests for the same locale return the same dictionary: >>> d1 = load('en_US') >>> d2 = load('en_US') >>> d1 is d2 True :param name: the locale identifier string (or "root") :param merge_inherited: whether the inherited data should be merged into the data of the requested locale :return: the locale data :rtype: `dict` :raise `IOError`: if no locale data file is found for the given locale identifer, or one of the locales it inherits from R t_iiÿÿÿÿs%s.dattrbN(t _cache_locktacquireRtgettsplittlenR RtcopyRRR topentmergetpickletclosetrelease(R tmerge_inheritedtdatatpartstparentRtfileobj((s4/usr/lib/python2.6/site-packages/babel/localedata.pyR=s*   cCsúxó|iƒD]å\}}|dj oÌ|i|ƒ}t|tƒo™|djo h}nt|tƒo||f}qät|tƒo5|\}}|iƒ}t||ƒ||f}qä|iƒ}t||ƒn|}|||>> d = {1: 'foo', 3: 'baz'} >>> merge(d, {1: 'Foo', 2: 'Bar'}) >>> d {1: 'Foo', 2: 'Bar', 3: 'baz'} :param dict1: the dictionary to merge into :param dict2: the dictionary containing the data that should be merged N( titemstNoneRt isinstancetdicttAliasttupleRR(tdict1tdict2tkeytval2tval1taliastothers((s4/usr/lib/python2.6/site-packages/babel/localedata.pyRus$        R*cBs)eZdZd„Zd„Zd„ZRS(s£Representation of an alias in the locale data. An alias is a value that refers to some other part of the locale data, as specified by the `keys`. cCst|ƒ|_dS(N(R+tkeys(tselfR3((s4/usr/lib/python2.6/site-packages/babel/localedata.pyt__init__scCsdt|ƒi|ifS(Ns<%s %r>(ttypet__name__R3(R4((s4/usr/lib/python2.6/site-packages/babel/localedata.pyt__repr__ scCsz|}x|iD]}||}qWt|tƒo|i|ƒ}n0t|tƒo|\}}|i|ƒ}n|S(sResolve the alias based on the given data. This is done recursively, so if one alias resolves to a second alias, that second alias will also be resolved. :param data: the locale data :type data: `dict` (R3R(R*tresolveR+(R4R"tbaseR.R1R2((s4/usr/lib/python2.6/site-packages/babel/localedata.pyR9£s   (R7t __module__t__doc__R5R8R9(((s4/usr/lib/python2.6/site-packages/babel/localedata.pyR*–s  tLocaleDataDictcBs,eZdZdd„Zd„Zd„ZRS(sUDictionary wrapper that automatically resolves aliases to the actual values. cCs4ti||ƒ|djo |}n||_dS(N(R)R5R'R:(R4R"R:((s4/usr/lib/python2.6/site-packages/babel/localedata.pyR5¼s  cCsÌti||ƒ}}t|tƒo|i|iƒ}nt|tƒo5|\}}|i|iƒiƒ}t||ƒnt |ƒtjot |d|iƒ}n||j o|||Âs  cCstti|ƒd|iƒS(NR:(R=R)RR:(R4((s4/usr/lib/python2.6/site-packages/babel/localedata.pyRÐsN(R7R;R<R'R5R>R(((s4/usr/lib/python2.6/site-packages/babel/localedata.pyR=·s  (R<RRt threadingt ImportErrortdummy_threadingtUserDictRt__all__t __docformat__RtRLockRRR tdirnamet__file__R RRRRRtobjectR*R)R=(((s4/usr/lib/python2.6/site-packages/babel/localedata.pyts$   ! 8 !!