g xddlZddlZddlmZddlmZddlmZmZdZ dZ Gdd ejZ d Z y) N)suppress)SimpleNamespace) _adaptersreaderscBtjfd}|S)zw Wrap _adapters.TraversableResourcesLoader.get_resource_reader and intercept any standard library readers. c |i|}|jj}|j dr|j dryt|tjrs|jjjjj ds9|jjjjj dry|S#t$rYyt$r}dt|vrYd}~yd}~wwxYw)z If the reader is from the standard library, return None to allow allow likely newer implementations in this library to take precedence. Nznot enough values to unpackz importlib.r zipimport_frozen_importlib_external) NotADirectoryError ValueErrorstr __class__ __module__ startswithendswith isinstancerCompatibilityFilesspecloader)argskwargsreaderexcmod_name reader_getters R/opt/hc_python/lib/python3.12/site-packages/importlib_resources/future/adapters.pywrapperz _block_standard..wrappers "D3F3F##..   | ,1B1B91M  fi:: ; KK   ( ( 3 3 > >{ K{{!!++66AA,  -"   -CH<   sC C>C>&C99C>) functoolswraps)rrs` r_block_standardr! s' __]#$> Nc`t|tjxr |j }|s|SdS)z/ Mask any degenerate reader. Ref #298. N)rrr_reader)r is_degenerates r_skip_degenerater&2s4 69778O=O'60D0r"c:eZdZdZfdZdZdZdZdZxZ S)TraversableResourcesLoaderz Adapt loaders to provide TraversableResources and other compatibility. Ensures the readers from importlib_resources are preferred over stdlib readers. cttt| |xs!|j xst| |SN)r&r!superget_resource_reader_standard_reader)selfnamers rr,z.TraversableResourcesLoader.get_resource_readerEsE I_UW-HI$O P 1$$& 1w*40 r"cj|jxs"|jxs|jSr*) _zip_reader_namespace_reader _file_readerr.s rr-z+TraversableResourcesLoader._standard_readerLs-!TT%;%;%=TARARATTr"ctt5tj|jj |jj cdddS#1swYyxYwr*)rAttributeErrorr ZipReaderrrr/r4s rr1z&TraversableResourcesLoader._zip_readerOs8 n %$$TYY%5%5tyy~~F& % %s >AA!cttt5tj|j j cdddS#1swYyxYwr*)rr6r rNamespaceReaderrsubmodule_search_locationsr4s rr2z,TraversableResourcesLoader._namespace_readerSs0 nj 1**499+O+OP2 1 1s )AAc tj|jj}|j rt jt|Sy#t$rYywxYw)N)path) pathlibPathrorigin TypeErrorexistsr FileReaderr)r.r<s rr3z'TraversableResourcesLoader._file_readerWsY << 0 01D ;;=%%o4&@A A   s)A A'&A') __name__r __qualname____doc__r,r-r1r2r3 __classcell__)rs@rr(r(<s% UGQBr"r(cJtj|jtS)z Override _adapters.wrap_spec to use TraversableResourcesLoader from above. Ensures that future behavior is always available on older Pythons. )rSpecLoaderAdapter__spec__r()packages r wrap_specrK`s  & &w'7'79S TTr") rr= contextlibrtypesrrrr!r&r(rKr"rrPs:!!&R1!B!E!E!BHUr"