Wc ddlZddlZddlZddlZddlZddlmZmZmZm Z m Z m Z ddl m Z eejefZeZdZdZededed e fd Zededed efd Ze ddedededed e f dZe ddedededed ef dZeded eefdZededed efdZededed eej8fdZdS)N)UnionIterableContextManagerBinaryIOTextIOAny)_commoncHtjfd}|S)Ncltjjdtd|i|S)Nz is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.) stacklevel)warningswarn__name__DeprecationWarning)argskwargsfuncs 4/usr/lib64/python3.12/importlib/resources/_legacy.pywrapperzdeprecated..wrappersQ }} P P P     tT$V$$$) functoolswraps)rrs` r deprecatedrs4__T%%%%% Nrct|}tjj|\}}|rt |d|S)zNormalize a path by ensuring it is a string. If the resulting string contains path separators, an exception is raised. z must be only a file name)strospathsplit ValueError)rstr_pathparent file_names rnormalize_pathr%sC 4yH h/FI vD===>> rpackageresourcereturncltj|t|z jdS)zDReturn a file-like object opened for binary reading of the resource.rbr filesr%openr&r's r open_binaryr/+s( MM' "^H%= = C CD IIrcjtj|t|z jS)z+Return the binary contents of the resource.)r r,r% read_bytesr.s r read_binaryr21s& MM' "^H%= = I I KKrutf-8strictencodingerrorscrtj|t|z jd||S)zBReturn a file-like object opened for text reading of the resource.r)r5r6r+)r&r'r5r6s r open_textr97s7 MM' "^H%= = C C hv D rctt||||5}|jcdddS#1swYdSxYw)zReturn the decoded string of the resource. The decoding-related arguments have the same semantics as those of bytes.decode(). N)r9read)r&r'r5r6fps r read_textr=Dsz 7Hh 72wwys-7c^dtj|jDS)zReturn an iterable of entries in `package`. Note that not all entries are resources. Specifically, directories are not considered resources. Use `is_resource()` on each entry returned here to check if it is a resource or not. c(g|]}|jS)name).0rs r zcontents..\s C C C$DIIII Cr)r r,iterdir)r&s rcontentsrETs( D C'--"8"@"@"B C CCrrAct|tfdtj|j DS)zYTrue if `name` is a resource inside `package`. Directories are *not* resources. c3\K|]%}|jko|j'dS)N)rAis_file)rB traversabler's r zis_resource..fsH  H$>)<)<)>>>>>r)r%anyr r,rD)r&rAr's @r is_resourcerL_sO d#H "==199; rcvtjtj|t|z S)akA context manager providing a file path object to the resource. If the resource does not already exist on its own on the file system, a temporary file will be created. If the file was created, the file will be deleted upon exiting the context manager (no exception is raised if the file was deleted prior to the context manager exiting). )r as_filer,r%r.s rrrls& ??7==1N84LL MMr)r3r4)rrpathlibtypesrtypingrrrrrrr ModuleTyperPackageResourcerr%r/bytesr2r9r=rEboolrLPathrr@rrrYs  IIIIIIIIIIIIIIII   #% &        JJHJJJJ J  LLHLLLL L                                DgD(3-DDD D           N  N NGLL! N N N  N N Nr