HEX
Server: Apache
System: Linux fan.fanlow.com 3.10.0-1160.144.1.el7.tuxcare.els9.x86_64 #1 SMP Fri Jul 10 17:06:31 UTC 2026 x86_64
User: ssiacademy (1163)
PHP: 8.2.32
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python2.7/site-packages/babel/localedata.pyc
�
d��ic@s6dZddlZddlZddlZddlZyddlZWnek
reddlZnXddlm	Z	dddgZ
dZiZej
�Zejjejje�d�Zejd	ej�Zd
�Zd�Zd�Zed
�Zd�Zdefd��YZde	efd��YZ dS(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
localedatas%^(con|prn|aux|nul|com[0-9]|lpt[0-9])$cCsjtjj|�}tjdkrStjtjj|�d�rStd|��ntjj	t
d|�S(s?
    Resolve a locale identifier to a `.dat` path on disk.
    twin32isName %s is invalid on Windowss%s.dat(tostpathtbasenametsystplatformt_windows_reserved_name_retmatchtsplitextt
ValueErrortjoint_dirname(tname((s4/usr/lib/python2.7/site-packages/babel/localedata.pytresolve_locale_filename(s
cCs&|tkrtStjjt|��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`
    (t_cachetTrueRRRR(R((s4/usr/lib/python2.7/site-packages/babel/localedata.pyR9scCs]ggtjt�D]}tjj|�^qD]*\}}|dkr/|dkr/|^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(RtlistdirRRR
(tfilenametstemt	extension((s4/usr/lib/python2.7/site-packages/babel/localedata.pyREs8cCstj�z�tj|�}|s|dks5|r>i}nO|jd�}t|�dkrhd}ndj|d �}t|�j�}t	|�}t
|d�}zH|dkr�|r�t|tj|��ntj|�}|t|<Wd|j
�Xn|SWdtj�XdS(s�Load 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
    :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
    Rt_ii����trbN(t_cache_locktacquireRtgettsplittlenRRtcopyRtopentmergetpickletclosetrelease(Rtmerge_inheritedtdatatpartstparentRtfileobj((s4/usr/lib/python2.7/site-packages/babel/localedata.pyRRs*
		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
isinstancetdicttAliasttupleR!R#(tdict1tdict2tkeytval2tval1taliastothers((s4/usr/lib/python2.7/site-packages/babel/localedata.pyR#�s"	
R0cBs)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(R1tkeys(tselfR9((s4/usr/lib/python2.7/site-packages/babel/localedata.pyt__init__�scCsdt|�j|jfS(Ns<%s %r>(ttypet__name__R9(R:((s4/usr/lib/python2.7/site-packages/babel/localedata.pyt__repr__�scCsv|}x|jD]}||}qWt|t�rE|j|�}n-t|t�rr|\}}|j|�}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`
        (R9R.R0tresolveR1(R:R(tbaseR4R7R8((s4/usr/lib/python2.7/site-packages/babel/localedata.pyR?�s	(R=t
__module__t__doc__R;R>R?(((s4/usr/lib/python2.7/site-packages/babel/localedata.pyR0�s		tLocaleDataDictcBs,eZdZdd�Zd�Zd�ZRS(sUDictionary wrapper that automatically resolves aliases to the actual
    values.
    cCs2tj||�|dkr%|}n||_dS(N(R/R;R-R@(R:R(R@((s4/usr/lib/python2.7/site-packages/babel/localedata.pyR;�s	cCs�tj||�}}t|t�r:|j|j�}nt|t�r}|\}}|j|j�j�}t||�nt	|�tkr�t
|d|j�}n||k	r�|||<n|S(NR@(R/t__getitem__R.R0R?R@R1R!R#R<RC(R:R4torigtvalR7R8((s4/usr/lib/python2.7/site-packages/babel/localedata.pyRD�s
cCsttj|�d|j�S(NR@(RCR/R!R@(R:((s4/usr/lib/python2.7/site-packages/babel/localedata.pyR!�sN(R=RARBR-R;RDR!(((s4/usr/lib/python2.7/site-packages/babel/localedata.pyRC�s	(!RBRR$treR	t	threadingtImportErrortdummy_threadingtUserDictRt__all__t
__docformat__RtRLockRRRtdirnamet__file__RtcompiletIRRRRRRR#tobjectR0R/RC(((s4/usr/lib/python2.7/site-packages/babel/localedata.pyt<module>s.
!			
8	!!