zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
U
«ý°dX    ã@szddlZddlZddlZddlZddlZddlmZmZddlm    Z    ddl
m Z m Z ddgdfdd„Z dd    „Zd
d „ZdS) éN)Ú
check_callÚ check_output)ÚTarFile)Ú METADATA_FNÚ ZONEFILENAMEÚgzc    st ¡‰tj ˆd¡}tj t¡}zÒt     
|¡8}|D]}|  |ˆ¡q4‡fdd„|Dƒ}    t ||    ƒW5QRXt
tj |t ¡dƒ}
tj||
dddW5QRXtj |t¡} t     
| d|¡0}t |¡D]} tj || ¡} | | | ¡qÈW5QRXW5t ˆ¡Xd    S)
z‹Rebuild the internal timezone info in dateutil/zoneinfo/zoneinfo*tar*
 
    filename is the timezone tarball from ``ftp.iana.org/tz``.
 
    Zzoneinfocsg|]}tj ˆ|¡‘qS©)ÚosÚpathÚjoin)Ú.0Ún©ZtmpdirrúPd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\dateutil/zoneinfo/rebuild.pyÚ
<listcomp>szrebuild.<locals>.<listcomp>ÚwéT)ÚindentÚ    sort_keyszw:%sN)ÚtempfileÚmkdtempr    r
r ÚdirnameÚ__file__ÚshutilÚrmtreerÚopenÚextractÚ_run_zicrÚjsonÚdumprÚlistdirÚadd)ÚfilenameÚtagÚformatZ
zonegroupsÚmetadataÚzonedirZ    moduledirÚtfÚnameÚ    filepathsÚfÚtargetÚentryZ    entrypathrrrÚrebuild s"  r-c
Csrztddgƒ}Wn,tk
r<}zt|ƒ‚W5d}~XYnXd|krPddg}ng}tdg|d|g|ƒdS)a½Calls the ``zic`` compiler in a compatible way to get a "fat" binary.
 
    Recent versions of ``zic`` default to ``-b slim``, while older versions
    don't even have the ``-b`` option (but default to "fat" binaries). The
    current version of dateutil does not support Version 2+ TZif files, which
    causes problems when used in conjunction with "slim" binaries, so this
    function is used to ensure that we always get a "fat" binary.
    Zzicz--helpNs-b z-bÚfatz-d)rÚOSErrorÚ_print_on_nosuchfiler)r&r)Ú    help_textÚeZ
bloat_argsrrrr)s
 
rcCs|jdkrt d¡dS)zdPrint helpful troubleshooting message
 
    e is an exception raised by subprocess.check_call()
 
    ézzCould not find zic. Perhaps you need to install libc-bin or some other package that provides it, or it's not in your PATH?N)ÚerrnoÚloggingÚerror)r2rrrr0As
ÿr0)r5r    rrrÚ
subprocessrrÚtarfilerZdateutil.zoneinforrr-rr0rrrrÚ<module>s