Wc c sddlZddlZddlZddlZddlZddlmZmZmZm Z m Z m Z ddl m Z eejefZeZdZdZededed e fd Zededed efd Ze ddedededed e f dZe ddedededed ef dZeded eefdZededed efdZededed eej8fdZdS)iN)UnionIterableContextManagerBinaryIOTextIOAnyi)_commoncsHtjfd}|S)Ncsltjjdtd|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.i)Z stacklevel)warningsZwarnZ__name__ZDeprecationWarning)ZargsZkwargsfunc 4/usr/lib64/python3.12/importlib/resources/_legacy.pywrapperzdeprecated..wrappersQ }} P P P     tT$V$$$) functoolsZwraps)rr s` r deprecatedrs4__T%%%%% Nr cst|}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)strospathZsplitZ ValueError)rZstr_pathZparentZ file_name r normalize_pathrsC 4yH h/FI vD===>> r packageresourceZreturncsltj|t|z jdS)zDReturn a file-like object opened for binary reading of the resource.ZrbrfilesrZopenrr r open_binaryr+s( MM' "^H%= = C CD IIr csjtj|t|z jS)z+Return the binary contents of the resource.)rrrZ read_bytesrrr read_binaryr1s& MM' "^H%= = I I KKr utf-8strictencodingerrorscsrtj|t|z jd||S)zBReturn a file-like object opened for text reading of the resource.Zr)rrr)rrrrrr open_textr 7s7 MM' "^H%= = C C hv D r cstt||||5}|jcdddS#1swYdSxYw)zReturn the decoded string of the resource. The decoding-related arguments have the same semantics as those of bytes.decode(). N)r Zread)rrrrZfps r read_textr!Dsz 7Hh 72wwys-7cs^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. cs(g|]}|jS)name).0rrr z zcontents..\s C C C$DIIII Cr )rriterdir)rs r contentsr&Ts( D C'--"8"@"@"B C CCr r#cst|tfdtj|j DS)zYTrue if `name` is a resource inside `package`. Directories are *not* resources. c3s\K|]%}|jko|j'dS)N)r#Zis_file)r$Z traversablerr r z zis_resource..fsH  H$>)<)<)>>>>>r )rZanyrrr%)rr#rs @r is_resourcer'_sO d#H "==199; r csvtjtj|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). )rZas_filerrrrr rrls& ??7==1N84LL MMr )rr)r rZpathlibZtypesrZtypingrrrrrrZrZ ModuleTyperZPackageZResourcerrrZbytesrr r!r&Zboolr'ZPathrr"r r r(s  IIIIIIIIIIIIIIII   #% &        JJHJJJJ J  LLHLLLL L                                DgD(3-DDD D           N  N NGLL! N N N  N N Nr