%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/babel/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/babel/__pycache__/localedata.cpython-312.pyc

�

ƪb���v�dZddlZddlZddlZddlZddlZddlmZddlm	Z	iZ
ej�Zejjejje�d�Zej$dej&�Zd�Zd�Zd	�Zd
�Zdd�Zd�ZGd
�d�ZGd�dej8�Zy)aG
    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-2022 by the Babel Team.
    :license: BSD, see LICENSE for more details.
�N)�abc)�chainzlocale-dataz%^(con|prn|aux|nul|com[0-9]|lpt[0-9])$c���|rt|t�sy|j�j�}t	j
tt�g�D]}||j�k(s�|cSy)z�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)�
isinstance�str�strip�lowerr�
from_iterable�_cache�locale_identifiers)�name�	locale_ids  �2/usr/lib/python3/dist-packages/babel/localedata.py�normalize_localers_���z�$��,���:�:�<����D��(�(�&�2D�2F�)G�H��	��9�?�?�$�$����c�:�tjj|�}tjdk(rCt
j
tjj|�d�rtd|z��tjjtd|z�S)z?
    Resolve a locale identifier to a `.dat` path on disk.
    �win32rzName %s is invalid on Windowsz%s.dat)�os�path�basename�sys�platform�_windows_reserved_name_re�match�splitext�
ValueError�join�_dirname)r
s r�resolve_locale_filenamer+sv���7�7���D�!�D��|�|�w��#<�#B�#B�2�7�7�CS�CS�TX�CY�Z[�C\�#]��8�4�?�@�@��7�7�<�<��(�T�/�2�2rc��|rt|t�sy|tvrytjjt
|��}|rdStt|��S)z�Check whether locale data is available for the given locale.

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

    :param name: the locale identifier string
    FT)	rrrrr�existsr�boolr)r
�
file_founds  rr!r!;sM���z�$��,���v�~������� 7�� =�>�J��4�?�4�(8��(>�#?�?rc���ttdd�}|�Hd�tjt�D�D��cgc]\}}|dk(r|dk7r|��c}}xt_}|Scc}}w)a�Return a list of all locale identifiers for which locale data is
    available.

    This data is cached after the first invocation in `locale_identifiers.cache`.

    Removing the `locale_identifiers.cache` attribute or setting it to `None`
    will cause this function to re-read the list from disk.

    .. versionadded:: 0.8.1

    :return: a list of locale identifiers (strings)
    �cacheNc3�ZK�|]#}tjj|����%y�w�N)rrr)�.0�filenames  r�	<genexpr>z%locale_identifiers.<locals>.<genexpr>\s����M�H�R�W�W�
�
�h�
'�M�s�)+z.dat�root)�getattrrr�listdirrr%)�data�stem�	extensions   rrrJsj���%�w��5�D��|�
N��
�
�8�8L�M�+
���i��F�"�t�v�~�
�+
�	
�� �4��K��
+
s�Ac���tjj|�}tj	�	t
j
|�}|s�|dk(s|si}nnddlm}|d�j
|�}|s6|jd�}t|�dk(rd}ndj|dd�}t|�j�}t|�}t|d	�5}|dk7r"|r t!|t#j|��nt#j|�}ddd�|t
|<|tj%�S#1swY�(xYw#tj%�wxYw)
aeLoad 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
    r+r)�
get_global�parent_exceptions�_�N����rb)rrr�_cache_lock�acquirer�get�
babel.corer2�split�lenr�load�copyr�open�merge�pickle�release)r
�merge_inheritedr.r2�parent�partsr)�fileobjs        rr>r>bs%��2�7�7���D�!�D�������z�z�$�����v�~�_���1�#�$7�8�<�<�T�B��� �J�J�s�O�E��5�z�Q��!'��!$���%���*�!5���F�|�(�(�*��.�t�4�H��h��%�
0���6�>�o��$����G� 4�5�!�;�;�w�/�D�	
0�
 �F�4�L������
0�
0��	����s$�B&E�=D?�E�?E�E�E!c�b�|j�D]�\}}|��	|j|�}t|t�rl|�i}t|t�r||f}nUt|t
�r&|\}}|j
�}t||�||f}n|j
�}t||�n|}|||<��y)anMerge 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)�itemsr:r�dict�Alias�tupler?rA)�dict1�dict2�key�val2�val1�alias�otherss       rrArA�s����[�[�]��	��T����9�9�S�>�D��$��%��<��D��d�E�*� �$�<�D���e�,�$(�M�E�6�#�[�[�]�F��&�$�'�!�6�?�D��9�9�;�D��$��%����E�#�J�%rc�"�eZdZdZd�Zd�Zd�Zy)rKz�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`.
    c�$�t|�|_yr')rL�keys)�selfrVs  r�__init__zAlias.__init__�s
���$�K��	rc�N�dt|�j�d|j�d�S)N�<� �>)�type�__name__rV�rWs r�__repr__zAlias.__repr__�s�� ��J�/�/����;�;rc���|}|jD]}||}�	t|t�r|j|�}|St|t�r|\}}|j|�}|S)z�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`
        )rVrrK�resolverL)rWr.�baserOrRrSs      rrbz
Alias.resolve�sl�����9�9�	�C���9�D�	��d�E�"��<�<��%�D�����e�
$� �M�E�6��=�=��&�D��rN)r^�
__module__�__qualname__�__doc__rXr`rb�rrrKrK�s��� �<�rrKc�<�eZdZdZd
d�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
y)�LocaleDataDictzUDictionary wrapper that automatically resolves aliases to the actual
    values.
    Nc�(�||_|�|}||_yr')�_datarc)rWr.rcs   rrXzLocaleDataDict.__init__�s����
��<��D���	rc�,�t|j�Sr')r=rkr_s r�__len__zLocaleDataDict.__len__�s���4�:�:��rc�,�t|j�Sr')�iterrkr_s r�__iter__zLocaleDataDict.__iter__�s���D�J�J��rc��|j|x}}t|t�r|j|j�}t|t
�r:|\}}|j|j�j
�}t||�t|�turt||j��}||ur||j|<|S�N)rc)rkrrKrbrcrLr?rAr]rJri)rWrO�orig�valrRrSs      r�__getitem__zLocaleDataDict.__getitem__�s����Z�Z��_�$��s��c�5�!��+�+�d�i�i�(�C��c�5�!��M�E�6��-�-��	�	�*�/�/�1�C��#�v����9��� ��4�9�9�5�C��d�?�!�D�J�J�s�O��
rc�"�||j|<yr'�rk)rWrO�values   r�__setitem__zLocaleDataDict.__setitem__�s����
�
�3�rc��|j|=yr'rw)rWrOs  r�__delitem__zLocaleDataDict.__delitem__�s
���J�J�s�Orc�`�t|jj�|j��Srr)rirkr?rcr_s rr?zLocaleDataDict.copys���d�j�j�o�o�/�d�i�i�@�@rr')r^rdrerfrXrmrpruryr{r?rgrrriri�s+����� �� ��Arri)T)rfrBr�rer�	threading�collectionsr�	itertoolsrr�RLockr8rr�dirname�__file__r�compile�Irrrr!rr>rArK�MutableMappingrirgrr�<module>r�s�����	�	�
����
���i�o�o���
�7�7�<�<�������1�=�A��&�B�J�J�'N�PR�PT�PT�U���
3� @��04�n�B��B&A�S�'�'�&Ar

Zerion Mini Shell 1.0