File: //lib/python3.6/site-packages/babel/__pycache__/localedata.cpython-36.pyc
3
�da� � @ s� d Z ddlZddlZddlZddlZddlmZ ddlmZ ddlZddl m
Z
mZ dd� Zi Z
ej� Zejje� d�Zejd ej�Zd
d� Zdd
� Zdd� Zdd� Zddd�Zdd� ZG dd� de�ZG dd� de�ZdS )aB
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.
� N)�MutableMapping)�chain)�pickle�string_typesc C s0 t tdd�r t tdd �r tj} ntjjt�} | S )N�frozenF�_MEIPASS)�getattr�sysr �os�path�dirname�__file__)Zbasedir� r � /usr/lib/python3.6/localedata.py�get_base_dir s r zlocale-dataz%^(con|prn|aux|nul|com[0-9]|lpt[0-9])$c C sP | st | t� rdS | j� j� } x(tjtt� g�D ]}| |j� kr4|S q4W dS )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)�
isinstancer �strip�lowerr �
from_iterable�_cache�locale_identifiers)�nameZ locale_idr r r �normalize_locale) s r c C sJ t jj| �} tjdkr8tjt jj| �d �r8td| ��t jj t
d| �S )z?
Resolve a locale identifier to a `.dat` path on disk.
Zwin32r zName %s is invalid on Windowsz%s.dat)r
r �basenamer �platform�_windows_reserved_name_re�match�splitext�
ValueError�join�_dirname)r r r r �resolve_locale_filename7 s r! c C sF | st | t� rdS | tkr"dS tjjt| ��}|r:dS tt| ��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) r r r r
r �existsr! �boolr )r Z
file_foundr r r r"