Vc 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 eejfdZdS)iN)UnionIterableContextManagerBinaryIOTextIOAnyi)_commoncsFtjfd}|S)Ncs\tjjdtd|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.11/importlib/resources/_legacy.pywrapperzdeprecated..wrappersR } P P P      tT$V$$$) functoolsZwraps)rr s` r deprecatedrs8_T%%%%% Nr cst|}tj|\}}|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_pathrsL 4yyH h//FI ?D===>>> r packageresourceZreturncsptj|t|z dS)zDReturn a file-like object opened for binary reading of the resource.ZrbrfilesrZopenrr r open_binaryr+s/ M' " "^H%=%= = C CD I IIr csntj|t|z S)z+Return the binary contents of the resource.)rrrZ read_bytesrrr read_binaryr1s- M' " "^H%=%= = I I K KKr utf-8strictencodingerrorscsvtj|t|z d||S)zBReturn a file-like object opened for text reading of the resource.Zr)rrr)rrrrrr open_textr 7s@ M' " "^H%=%= = C C hv D  r cst||||5}|cdddS#1swxYwYdS)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!Ds 7Hh 7 72wwyys 488csbdtj|DS)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. csg|] }|j S)name).0rrr z zcontents..\s C C C$DI C C Cr )rriterdir)rs r contentsr&Ts/ D C'-"8"8"@"@"B"B C C CCr r#cst|tfdtj|DS)zYTrue if `name` is a resource inside `package`. Directories are *not* resources. c3sVK|]#}|jko|V$dS)N)r#Zis_file)r$Z traversablerr r z zis_resource..fsP  H$>)<)<)>)>r )rZanyrrr%)rr#rs @r is_resourcer'_s` d##H "=1199;;  r csntjtj|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=11N84L4LL M MMr )rr)r rZpathlibZtypesrZtypingrrrrrrZrZ ModuleTyperZPackageZResourcerrrZbytesrr r!r&Zboolr'ZPathrr"r r r(s  IIIIIIIIIIIIIIII  #% &        JJHJJJJ J  LLHLLLL L                                DgD(3-DDD D           N  N NGL! N N N  N N Nr