관리-도구
편집 파일: localedata.cpython-39.pyc
a �`� � @ s� d Z ddlZddlZddlZddlZddlmZ ddlmZm Z m Z i Ze�� Z ej�ej�e�d�Ze�dej�Zdd� Zd d � Zdd� Zd d� Zddd�Zdd� ZG dd� de�ZG dd� de j�ZdS )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-2021 by the Babel Team. :license: BSD, see LICENSE for more details. � N)�chain)�pickle�string_types�abczlocale-dataz%^(con|prn|aux|nul|com[0-9]|lpt[0-9])$c C sL | rt | t�sdS | �� �� } t�tt� g�D ]}| |�� kr.| S q.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_id� r �4/usr/lib/python3.9/site-packages/babel/localedata.py�normalize_locale s r c C sJ t j�| �} tjdkr8t�t j�| �d �r8td| ��t j� t d| �S )z? Resolve a locale identifier to a `.dat` path on disk. �win32r zName %s is invalid on Windowsz%s.dat)�os�path�basename�sys�platform�_windows_reserved_name_re�match�splitext� ValueError�join�_dirname)r r r r �resolve_locale_filename, s r c C sB | rt | t�sdS | tv rdS tj�t| ��}|r6dS 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 <