%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/babel/
Upload File :
Create Path :
Current File : //proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/babel/localedata.pyo

�
���Qc@s�dZddlZddlZddlmZddlmZiZej�Z	ej
jej
je
�d�Zd�Zd�Zed�Zd	�Zd
efd��YZdefd
��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(tpicklet
localedatacCs3|tkrtStjjtjjtd|��S(s�Check whether locale data is available for the given locale.  Ther
    return value is `True` if it exists, `False` otherwise.

    :param name: the locale identifier string
    s%s.dat(t_cachetTruetostpathtexiststjoint_dirname(tname((sA/opt/alt/python27/lib/python2.7/site-packages/babel/localedata.pyRs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(RtlistdirR	Rtsplitext(tfilenametstemt	extension((sA/opt/alt/python27/lib/python2.7/site-packages/babel/localedata.pytlocale_identifiers&s8cCs%tj�z	tj|�}|s|dks5|r>i}nO|jd�}t|�dkrhd}ndj|d �}t|�j�}t	j
jtd|�}t|d�}zH|dkr�|r�t
|tj|��ntj|�}|t|<Wd|j�Xn|SWdtj�XdS(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
    Rt_ii����s%s.dattrbN(t_cache_locktacquireRtgettsplittlenRtloadtcopyRRR	topentmergeRtclosetrelease(R
tmerge_inheritedtdatatpartstparentRtfileobj((sA/opt/alt/python27/lib/python2.7/site-packages/babel/localedata.pyR3s*
		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(s�Merge the data from `dict2` into the `dict1` dictionary, making copies
    of nested dictionaries.

    >>> d = {1: 'foo', 3: 'baz'}
    >>> merge(d, {1: 'Foo', 2: 'Bar'})
    >>> items = d.items(); items.sort(); 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
isinstancetdicttAliasttupleRR(tdict1tdict2tkeytval2tval1taliastothers((sA/opt/alt/python27/lib/python2.7/site-packages/babel/localedata.pyRis"	
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(tselfR1((sA/opt/alt/python27/lib/python2.7/site-packages/babel/localedata.pyt__init__�scCsdt|�j|jfS(Ns<%s %r>(ttypet__name__R1(R2((sA/opt/alt/python27/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`
        (R1R&R(tresolveR)(R2R tbaseR,R/R0((sA/opt/alt/python27/lib/python2.7/site-packages/babel/localedata.pyR7�s	(R5t
__module__t__doc__R3R6R7(((sA/opt/alt/python27/lib/python2.7/site-packages/babel/localedata.pyR(�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%R8(R2R R8((sA/opt/alt/python27/lib/python2.7/site-packages/babel/localedata.pyR3�s		cCs
t|j�S(N(RR<(R2((sA/opt/alt/python27/lib/python2.7/site-packages/babel/localedata.pyt__len__�scCs
t|j�S(N(titerR<(R2((sA/opt/alt/python27/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(NR8(R<R&R(R7R8R)RRR4R'R;(R2R,torigtvalR/R0((sA/opt/alt/python27/lib/python2.7/site-packages/babel/localedata.pyt__getitem__�scCs||j|<dS(N(R<(R2R,tvalue((sA/opt/alt/python27/lib/python2.7/site-packages/babel/localedata.pyt__setitem__�scCs|j|=dS(N(R<(R2R,((sA/opt/alt/python27/lib/python2.7/site-packages/babel/localedata.pyt__delitem__�scCst|jj�d|j�S(NR8(R;R<RR8(R2((sA/opt/alt/python27/lib/python2.7/site-packages/babel/localedata.pyR�sN(R5R9R:R%R3R=R?RBRDRER(((sA/opt/alt/python27/lib/python2.7/site-packages/babel/localedata.pyR;�s					(R:Rt	threadingtcollectionsRt
babel._compatRRtRLockRRRtdirnamet__file__R	RRRRRtobjectR(R;(((sA/opt/alt/python27/lib/python2.7/site-packages/babel/localedata.pyt<module>
s!		
6	!!

Zerion Mini Shell 1.0