Viewing File: /opt/alt/python-internal/lib64/python3.11/zoneinfo/__pycache__/_tzpath.cpython-311.pyc
!A?h d dl Z d dlZd
dZd Zd Zd Ze j e j dd dd Z e fdZ
[ d Z G d
de Z
da e dS ) Nc | }|t |t t f r%t ddt | d|z t t
t j j | st t | |}nSt j
dd }|t | }n!t t j d }t# | ad S )Nz!tzpaths must be a list or tuple, znot z: PYTHONTZPATHTZPATH)
isinstancestrbytes TypeErrortypeallmapospathisabs
ValueError_get_invalid_paths_messageenvironget_parse_python_tzpath sysconfigget_config_vartupler )totzpathsbase_tzpathenv_vars =/opt/alt/python-internal/lib64/python3.11/zoneinfo/_tzpath.pyreset_tzpathr s GgU|,, 45g55'556
3rw}g..// B7@@AAA*..66.w77KK.(22 K ;
FFF c F | sdS | t j }t t t j j | }t | t | k r1dd l}t | }|
d|z t |S )N r z>Invalid paths specified in PYTHONTZPATH environment variable. )splitr
pathsepr filterr r lenwarningsr warnInvalidTZPathWarning)r
raw_tzpath
new_tzpathr% msgs r r r s rrz**JvbgmZ8899J :#j//))(44
L
r c X d | D }d}|| | z }d|z S )Nc 3 X K | ]%}t j | !|V &d S N)r
r r ).0r s r <genexpr>z-_get_invalid_paths_message.<locals>.<genexpr>6 s5 IIdRW]]45H5HITIIIIIIr z
z@Paths should be absolute but found the following relative paths:)join)r
invalid_pathsprefixindented_strs r r r 5 sC IIgIIIM
FFKK
666L K
r c t | t D ]E}t j || }t j | r|c S FdS )z,Retrieve the path to a TZif file from a key.N)_validate_tzfile_pathr r
r r0 isfile)keysearch_pathfilepaths r find_tzfiler: A s_ # 7<<S11
7>>(## OOO 4r _c t j | rt d| t j | }t | t | k rt d| t j t j || }| | st d| d S )Nz.ZoneInfo keys may not be absolute paths, got: z6ZoneInfo keys must be normalized relative paths, got: z;ZoneInfo keys must refer to subdirectories of TZPATH, got: )r
r r r normpathr$ r0
startswith)r _basenew_pathresolveds r r5 r5 O s w}}T
CTCC
w%%H
8}}D !!KTKK
wUH = =>>Hu%%
P$PP
r c ddl m} t } | d d d 5 }|D ]-}| }|r| | . ddd n# 1 swxY w Y n# t t f$ r Y nw xY wd }t D ]}t j
| s#t j | D ]\ }}}||k r2d|v r| d d |v r| d |D ]} t j || }
t j |
|
}t j dk r | t j d }|r||v rz ||
r| | ܐd|v r| d |S )
a" Returns a set containing all available time zones.
.. caution::
This may attempt to open a large number of files, since the best way to
determine if a given file on the time zone search path is to open it
and check for the "magic string" at the beginning.
r ) resourcestzdatazonesrNc t | d 5 }| d dk cd d d S # 1 swxY w Y d S # t $ r Y dS w xY w)Nrb s TZifF)openread Exception)fpathfs r valid_keyz&available_timezones.<locals>.valid_key s eT""