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

124 lines
13 KiB
Plaintext
Raw Normal View History

Ë
j­#ãóæUdZddlmZddlZddlZddlZddlZddlZddlm Z ddl
m Z m Z m
Z
ddlmZddlmZddlmZiZd ed
<ej,«Zej0j3ej0j5e«d «Zej:d ej<«Zdd
Z ddZ!ddZ"ed¬«dd«Z#ddZ$dddZ%ddZ&Gdd«Z'Gdde 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Óˆ Ø 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ô ‡||Ô#<×#BÑ#BÄ2Ç7Á7×CSÑCSÐTXÓCYÐZ[ÑC\Ô#]ܘ5  Ð&<Ð 7‰7<‰<œ T F¨$  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Ô(8¸Ó(>Ó#?Ð?r)Úmaxsizecóˆdtjt«D«Dcgc]\}}|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ŒBG‰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÷Ù2>¸tÓ2DЈi˜ ¨4ñ ™y±ÁÙ"Ð#3Ó4×8¸Ó>ˆ
Ù".¨}Ó"=Јˆ1ˆm˜˜Ñ øô òÙðú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Š~¡_Øå#Ð$7Ó8×<¸BÙÜ,¨TÔ2Ø!'™à $§
¡
¨3£˜Ü+.¨u«:¸ª?¡ÀÇÁÈÈsÐPRÈÓ@T˜Ü˜F“|×*Ü.¨tÓ4ˆÓ
ؘ6’>¡oܘ$¤§ ¡ ¨GÓ 4Õ!Ÿ;™; /
 ŒF4‰LØä×ÑÕ÷

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°ð—[‘[“]ò‰ ˆˆTØ Ñ Ø—9‘9˜S“>ˆ˜Ô˜d¤EÔ  $˜< ¤eÔ,Ø$(ME˜#Ÿ[™[]˜& ! 6˜?Ÿ9™9;˜$ Õ؈E#ŠJñ%rcó(eZdZdZddZddZddZy) 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óNdt|«jd|jdS) ú>)ÚtypeÚ__name__rh©ris rÚ__repr__zAlias.__repr__Ûs&Ø”4˜“:×' ¯©¨
°QÐ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.