File: //opt/alt/python38/lib/python3.8/site-packages/babel/__pycache__/core.cpython-38.pyc
U
�`+� � ( @ s d Z ddlZddlmZ ddlmZmZ ddlmZ dddd d
gZ da
ei �Zdd� Zd
d� Z
dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6�'ZG d7d� de�ZG d8d� de�Zdefd9d�Zd:efd;d �Zd?d<d
�Zd@d=d>�ZdS )Az�
babel.core
~~~~~~~~~~
Core locale representation and locale data access.
:copyright: (c) 2013-2021 by the Babel Team.
:license: BSD, see LICENSE for more details.
� N)�
localedata)�pickle�string_types)�
PluralRule�UnknownLocaleError�Locale�default_locale�negotiate_locale�parse_localec C s t d��d S )Nz�The babel data files are not available. This usually happens because you are using a source checkout from Babel and you did not build the data files. Just make sure to run "python setup.py import_cldr" before installing the library.)�RuntimeError� r r �;/opt/alt/python38/lib/python3.8/site-packages/babel/core.py�_raise_no_data_error s r c C sh t dkr\tj�tj�t��}tj�|d�}tj�|�s<t� t|d��}t �
|�a W 5 Q R X t �| i �S )a_ Return the dictionary for the given key in the global data.
The global data is stored in the ``babel/global.dat`` file and contains
information independent of individual locales.
>>> get_global('zone_aliases')['UTC']
u'Etc/UTC'
>>> get_global('zone_territories')['Europe/Berlin']
u'DE'
The keys available are:
- ``all_currencies``
- ``currency_fractions``
- ``language_aliases``
- ``likely_subtags``
- ``parent_exceptions``
- ``script_aliases``
- ``territory_aliases``
- ``territory_currencies``
- ``territory_languages``
- ``territory_zones``
- ``variant_aliases``
- ``windows_zone_mapping``
- ``zone_aliases``
- ``zone_territories``
.. note:: The internal structure of the data may change between versions.
.. versionadded:: 0.9
:param key: the data key
Nz
global.dat�rb)�_global_data�os�path�join�dirname�__file__�isfiler �openr �load�get)�keyr �filename�fileobjr r r
�
get_global# s #r Zar_SYZbg_BGZbs_BAZca_ESZcs_CZZda_DKZde_DEZel_GRZen_USZes_ESZet_EEZfa_IRZfi_FIZfr_FRZgl_ESZhe_ILZhu_HUZid_IDZis_ISZit_ITZja_JPZkm_KHZko_KRZlt_LTZlv_LVZmk_MKZnl_NLZnn_NOZnb_NOZpl_PLZpt_PTZro_ROZru_RUZsk_SKZsl_SIZsv_SEZth_THZtr_TRZuk_UA)'ZarZbg�bsZcaZcsZdaZdeZel�enZesZetZfa�fi�frZglZheZhu�id�is�itZjaZkmZko�ltZlvZmk�nlZnnZnoZplZptZroZruZskZslZsvZthZtrZukc @ s e Zd ZdZdd� ZdS )r z[Exception thrown when a locale is requested for which no locale data
is available.
c C s t �| d| � || _dS )zjCreate the exception.
:param identifier: the identifier string of the unsupported locale
zunknown locale %rN)� Exception�__init__�
identifier)�selfr) r r r
r( a s zUnknownLocaleError.__init__N)�__name__�
__module__�__qualname__�__doc__r( r r r r
r \ s c @ s� e Zd ZdZdrdd�Zedefdd��Zedefdd ��Zedsdd��Z d
d� Z
dd� Zdd� Zdd� Z
dd� Zedd� �Zdtdd�Zeedd�Zdudd�Zeedd�Zdvd d!�Zeed"d�Zdwd#d$�Zeed%d�Zed&d'� �Zed(d)� �Zed*d+� �Zed,d-� �Zed.d/� �Zed0d1� �Zed2d3� �Zed4d5� �Z ed6d7� �Z!ed8d9� �Z"ed:d;� �Z#ed<d=� �Z$ed>d?� �Z%ed@dA� �Z&edBdC� �Z'edDdE� �Z(edFdG� �Z)edHdI� �Z*edJdK� �Z+edLdM� �Z,edNdO� �Z-edPdQ� �Z.edRdS� �Z/edTdU� �Z0edVdW� �Z1edXdY� �Z2edZd[� �Z3ed\d]� �Z4ed^d_� �Z5ed`da� �Z6edbdc� �Z7eddde� �Z8edfdg� �Z9edhdi� �Z:edjdk� �Z;edldm� �Z<edndo� �Z=edpdq� �Z>dS )xr aY Representation of a specific locale.
>>> locale = Locale('en', 'US')
>>> repr(locale)
"Locale('en', territory='US')"
>>> locale.display_name
u'English (United States)'
A `Locale` object can also be instantiated from a raw locale string:
>>> locale = Locale.parse('en-US', sep='-')
>>> repr(locale)
"Locale('en', territory='US')"
`Locale` objects provide access to a collection of locale data, such as
territory and language names, number and date format patterns, and more:
>>> locale.number_symbols['decimal']
u'.'
If a locale is requested for which no locale data is available, an
`UnknownLocaleError` is raised:
>>> Locale.parse('en_XX')
Traceback (most recent call last):
...
UnknownLocaleError: unknown locale 'en_XX'
For more information see :rfc:`3066`.
Nc C s<