Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
contego / home / tvault / .virtenv / lib / python2.7 / site-packages / babel / localedata.pyc
Size: Mime:
ó
ô’EYc@sádZddlZddlZddlmZddlmZddlmZiZ	ej
ƒZejj
ejjeƒdƒZd„Zd„Zd	„Zed
„Zd„Zdefd
„ƒYZdefd„ƒYZdS(sB
    babel.localedata
    ~~~~~~~~~~~~~~~~

    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.

    :copyright: (c) 2013 by the Babel Team.
    :license: BSD, see LICENSE for more details.
iÿÿÿÿN(tMutableMapping(tchain(tpickleslocale-datacCsO|jƒjƒ}x6tjttƒgƒD]}||jƒkr+|Sq+WdS(sŸNormalize a locale ID by stripping spaces and apply proper casing.

    Returns the normalized locale ID string or `None` if the ID is not
    recognized.
    N(tstriptlowerRt
from_iterablet_cachetlocale_identifiers(tnamet	locale_id((sE/home/tvault/.virtenv/lib/python2.7/site-packages/babel/localedata.pytnormalize_localescCsO|tkrtStjjtjjtd|ƒƒ}|r?tStt|ƒƒS(s¥Check whether locale data is available for the given locale.

    Returns `True` if it exists, `False` otherwise.

    :param name: the locale identifier string
    s%s.dat(	RtTruetostpathtexiststjoint_dirnametboolR
(Rt
file_found((sE/home/tvault/.virtenv/lib/python2.7/site-packages/babel/localedata.pyR(s%cCs]ggtjtƒD]}tjj|ƒ^qD]*\}}|dkr/|dkr/|^q/S(s¦Return a list of all locale identifiers for which locale data is
    available.

    .. versionadded:: 0.8.1

    :return: a list of locale identifiers (strings)
    s.dattroot(RtlistdirRR
tsplitext(tfilenametstemt	extension((sE/home/tvault/.virtenv/lib/python2.7/site-packages/babel/localedata.pyR5s8cCsStjƒz7tj|ƒ}|s<|dks5|r>i}n}ddlm}|dƒj|ƒ}|s©|jdƒ}t|ƒdkr“d}q©dj|d ƒ}nt	|ƒj
ƒ}tjjt
d|ƒ}t|dƒ}zH|dkr|rt|tj	|ƒƒntj	|ƒ}|t|<Wd	|jƒXn|SWd	tjƒXd	S(
seLoad the locale data for the given locale.

    The locale data is a dictionary that contains much of the data defined by
    the Common Locale Data Repository (CLDR). This data is stored as a
    collection of pickle files inside the ``babel`` package.

    >>> 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
    :raise `IOError`: if no locale data file is found for the given locale
                      identifer, or one of the locales it inherits from
    Riÿÿÿÿ(t
get_globaltparent_exceptionst_is%s.dattrbN(t_cache_locktacquireRtgett
babel.coreRtsplittlenRtloadtcopyRR
RtopentmergeRtclosetrelease(Rtmerge_inheritedtdataRtparenttpartsRtfileobj((sE/home/tvault/.virtenv/lib/python2.7/site-packages/babel/localedata.pyR#Bs0
		cCsðxé|jƒD]Û\}}|dk	r
|j|ƒ}t|tƒrÕ|dkrXi}nt|tƒrv||f}qÛt|tƒr¹|\}}|jƒ}t||ƒ||f}qÛ|jƒ}t||ƒn|}|||<q
q
WdS(snMerge the data from `dict2` into the `dict1` dictionary, making copies
    of nested dictionaries.

    >>> d = {1: 'foo', 3: 'baz'}
    >>> merge(d, {1: 'Foo', 2: 'Bar'})
    >>> sorted(d.items())
    [(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
isinstancetdicttAliasttupleR$R&(tdict1tdict2tkeytval2tval1taliastothers((sE/home/tvault/.virtenv/lib/python2.7/site-packages/babel/localedata.pyR&{s"	
R2cBs)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(R3tkeys(tselfR;((sE/home/tvault/.virtenv/lib/python2.7/site-packages/babel/localedata.pyt__init__£scCsdt|ƒj|jfS(Ns<%s %r>(ttypet__name__R;(R<((sE/home/tvault/.virtenv/lib/python2.7/site-packages/babel/localedata.pyt__repr__¦scCsv|}x|jD]}||}qWt|tƒrE|j|ƒ}n-t|tƒrr|\}}|j|ƒ}n|S(sôResolve 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`
        (R;R0R2tresolveR3(R<R*tbaseR6R9R:((sE/home/tvault/.virtenv/lib/python2.7/site-packages/babel/localedata.pyRA©s	(R?t
__module__t__doc__R=R@RA(((sE/home/tvault/.virtenv/lib/python2.7/site-packages/babel/localedata.pyR2œs		tLocaleDataDictcBsPeZdZdd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
RS(	sUDictionary wrapper that automatically resolves aliases to the actual
    values.
    cCs+||_|dkr|}n||_dS(N(t_dataR/RB(R<R*RB((sE/home/tvault/.virtenv/lib/python2.7/site-packages/babel/localedata.pyR=Âs		cCs
t|jƒS(N(R"RF(R<((sE/home/tvault/.virtenv/lib/python2.7/site-packages/babel/localedata.pyt__len__ÈscCs
t|jƒS(N(titerRF(R<((sE/home/tvault/.virtenv/lib/python2.7/site-packages/babel/localedata.pyt__iter__ËscCsÂ|j|}}t|tƒr5|j|jƒ}nt|tƒrx|\}}|j|jƒjƒ}t||ƒnt|ƒt	kr¢t
|d|jƒ}n||k	r¾||j|<n|S(NRB(RFR0R2RARBR3R$R&R>R1RE(R<R6torigtvalR9R:((sE/home/tvault/.virtenv/lib/python2.7/site-packages/babel/localedata.pyt__getitem__ÎscCs||j|<dS(N(RF(R<R6tvalue((sE/home/tvault/.virtenv/lib/python2.7/site-packages/babel/localedata.pyt__setitem__ÜscCs|j|=dS(N(RF(R<R6((sE/home/tvault/.virtenv/lib/python2.7/site-packages/babel/localedata.pyt__delitem__ßscCst|jjƒd|jƒS(NRB(RERFR$RB(R<((sE/home/tvault/.virtenv/lib/python2.7/site-packages/babel/localedata.pyR$âsN(R?RCRDR/R=RGRIRLRNROR$(((sE/home/tvault/.virtenv/lib/python2.7/site-packages/babel/localedata.pyRE½s					(RDRt	threadingtcollectionsRt	itertoolsRt
babel._compatRRtRLockRR
Rtdirnamet__file__RR
RRRR#R&tobjectR2RE(((sE/home/tvault/.virtenv/lib/python2.7/site-packages/babel/localedata.pyt<module>
s!		
	
9	!!