Files
intellecton/venv/lib/python3.12/site-packages/babel/__pycache__/localedata.cpython-312.pyc
T

124 lines
13 KiB
Plaintext
Raw Normal View History

Ë
gÀj­#ãóæ—UdZddlmZddlZddlZddlZddlZddlZddlm Z ddl
m Z m Z m
Z
ddlmZddlmZddlmZiZd ed
<ej,«Zej0j3ej0j5e«d «Zej:d ej<«Zdd
„Z dd„Z!dd„Z"ed¬«dd„«Z#dd„Z$ddd„Z%dd„Z&Gd„d«Z'Gd„de j«Z(y) a+
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-2026 by the Babel Team.
:license: BSD, see LICENSE for more details.
é)Ú annotationsN)Úabc)ÚIteratorÚMappingÚMutableMapping)Ú lru_cache)Úchain)ÚAnyúdict[str, Any]Ú_cachez locale-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_iterabler Úlocale_identifiers)ÚnameÚ locale_ids úS/home/antigravity/intellecton/venv/lib/python3.12/site-packages/babel/localedata.pyÚnormalize_localer!s_€ñ ”z $¬Ô,ØØ �:‰:‹<× Ñ Ó €DÜ×(Ñ(¬&Ô2DÓ2FÐ)GÓHòˆ Ø �9—?‘?Ó$Ó $ØÒ ñócó<—tjj|«}tjdk(rDt
j
tjj|«d«rtd|›d�«‚tjjt|›d�«S)z?
Resolve a locale identifier to a `.dat` path on disk.
Úwin32rzName z is invalid on Windowsú.dat) ÚosÚpathÚbasenameÚsysÚplatformÚ_windows_reserved_name_reÚmatchÚsplitextÚ
ValueErrorÚjoinÚ_dirname)rs rÚresolve_locale_filenamer'/s|€ô �7‰7× Ñ ˜DÓ !€Dô ‡|�|�wÒÔ#<×#BÑ#BÄ2Ç7Á7×CSÑCSÐTXÓCYÐZ[ÑC\Ô#]ܘ5  Ð&<Ð=Ó>Ð>ô �7‰7�<‰<œ T F¨$ -Ó 0Ð0rcóº—|rt|t«sy|tvrytjj t
|««}|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) rrr rrÚexistsr'Úboolr)rÚ
file_founds rr)r)?sM€ñ ”z $¬Ô,ØØ Œv�~ØÜ—‘—‘Ô 7¸Ó =Ó>€JÙˆ4Ð?¤4Ô(8¸Ó(>Ó#?Ð?r)Úmaxsizecóˆ—d„tjt«D«D��cgc]\}}|dk(r|dk7r|‘Œc}}Scc}}w)a&Return a list of all locale identifiers for which locale data is
available.
This data is cached after the first invocation.
You can clear the cache by calling `locale_identifiers.cache_clear()`.
.. versionadded:: 0.8.1
:return: a list of locale identifiers (strings)
c3óZK—|]#}tjj|«–—Œ%y­w©N)rrr#)Ú.0Úfilenames rú <genexpr>z%locale_identifiers.<locals>.<genexpr>\s$èø€ò
Ø+3ŒB�G‰G× Ñ ˜X× &ñ
ùs‚)+rÚroot)rÚlistdirr&)ÚstemÚ extensions rrrNsI€ñ
Ü79·z±zÄ(Ó7Kô
÷ á ˆD�)ð ˜Ò  4¨6¢>ò
ó ðùó s¤>có²—ddlm}m} ||«^}}}}}|r0|r.|s,|s*|s(|d«j |«}||«^} } }
} ||
k7Sy#t$rYywxYw)aReturn whether the locale is of the form ``lang_Script``,
and the script is not the likely script for the language.
This implements the behavior of the ``nonlikelyScript`` value of the
``localRules`` attribute for parent locales added in CLDR 45.
r)Ú
get_globalÚ parse_localeFÚlikely_subtags)Ú
babel.corer8r9r$Úget) rr8r9ÚlangÚ territoryÚscriptÚvariantÚrestÚ
likely_subtagÚ_Ú
likely_scripts rÚ_is_non_likely_scriptrEcsy€÷4ðÙ2>¸tÓ2DÐ/ˆˆi˜ ¨4ñ ‘™y±ÁÙ"Ð#3Ó4×8Ñ8¸Ó>ˆ
Ù".¨}Ó"=Јˆ1ˆm˜aؘÑ&Ð&Ø øô òÙðúsŠ
A
Á
AÁAcóâ—tjj|«}tj « t
j
|«}|sê|dk(s|si}n{ddlm}|d«j
|«}|sCt|«rd}n5|jd«}t|«dk(rdndj|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']
'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
identifier, or one of the locales it inherits from
r3r)r8Úparent_exceptionsrCéNéÿÿÿÿÚrb)rrrÚ _cache_lockÚacquirer r<r;r8rEÚsplitÚlenr%ÚloadÚcopyr'ÚopenÚmergeÚpickleÚrelease)rÚmerge_inheritedÚdatar8ÚparentÚpartsr1Úfileobjs rrOrOxs/€ô2 �7‰7× Ñ ˜DÓ !€DÜ×ÑÔðÜ�z‰z˜$ÓˆÙà�vŠ~¡_Ø‘å1á#Ð$7Ó8×<Ñ<¸TÓB�ÙÜ,¨TÔ2Ø!'™à $§
¡
¨3£˜Ü+.¨u«:¸ª?¡ÀÇÁÈÈsÐPRÈÓ@T˜Ü˜F“|×(Ñ(Ó*�Ü.¨tÓ4ˆHÜ�h Ó%ð
0¨Ø˜6’>¡oܘ$¤§ ¡ ¨GÓ 4Õ5ä!Ÿ;™; wÓ/�D÷ 
0ð
 ŒF�4‰LØä×ÑÕ÷
0ð
0ûô ×ÑÕús$µB3EÃ(=E Ä%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ÚtuplerPrR)Údict1Údict2ÚkeyÚval2Úval1ÚaliasÚotherss rrRrR°s«€ð—[‘[“]ò‰ ˆˆTØ Ñ Ø—9‘9˜S“>ˆDܘ$¤Ô%Ø�<Ø�Dܘd¤EÔ*Ø  $˜<‘DÜ ¤eÔ,Ø$(‘M�E˜6Ø#Ÿ[™[›]�Fܘ& $Ô'Ø! 6˜?‘DàŸ9™9›;�Dܘ$ Õ%à�؈E�#ŠJñ%rcó(—eZdZdZdd„Zdd„Zdd„Zy) r]zŸ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/)r^Úkeys)Úselfrhs rÚ__init__zAlias.__init__Øs
€Ü˜$“Kˆ� rcóN—dt|«j›d|j›d�S)Nú<ú ú>)ÚtypeÚ__name__rh©ris rÚ__repr__zAlias.__repr__Ûs&€Ø”4˜“:×&Ñ&Ð' q¨¯©¨
°QÐ7Ð7rcóÈ—|}|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.