3
X'íc¾ ã @ sÊ d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z i Z
ej Zej
jej
jedZejdejZdd Zd d
Zdd Zd
d ZdddZdd ZG dd dZG dd dejZdS )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 C sP | st | t rdS | j j } x(tjtt gD ]}| |j kr4|S q4W dS )zNormalize 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)ÚnameZ locale_id© r ú1/tmp/pip-build-gk9425m9/babel/babel/localedata.pyÚ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.
Ú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