/opt/imh-python/lib/python3.9/importlib/__pycache__
NameSizeModeActions
abc.cpython-39.opt-1.pyc168260644editdlrm
abc.cpython-39.opt-2.pyc92630644editdlrm
abc.cpython-39.pyc168260644editdlrm
machinery.cpython-39.opt-1.pyc9730644editdlrm
machinery.cpython-39.opt-2.pyc8330644editdlrm
machinery.cpython-39.pyc9730644editdlrm
metadata.cpython-39.opt-1.pyc216300644editdlrm
metadata.cpython-39.opt-2.pyc158630644editdlrm
metadata.cpython-39.pyc216300644editdlrm
resources.cpython-39.opt-1.pyc64000644editdlrm
resources.cpython-39.opt-2.pyc49780644editdlrm
resources.cpython-39.pyc64000644editdlrm
util.cpython-39.opt-1.pyc93310644editdlrm
util.cpython-39.opt-2.pyc64620644editdlrm
util.cpython-39.pyc93310644editdlrm
_bootstrap.cpython-39.opt-1.pyc289610644editdlrm
_bootstrap.cpython-39.opt-2.pyc222020644editdlrm
_bootstrap.cpython-39.pyc289770644editdlrm
_bootstrap_external.cpython-39.opt-1.pyc447670644editdlrm
_bootstrap_external.cpython-39.opt-2.pyc336600644editdlrm
_bootstrap_external.cpython-39.pyc451790644editdlrm
_common.cpython-39.opt-1.pyc17080644editdlrm
_common.cpython-39.opt-2.pyc14690644editdlrm
_common.cpython-39.pyc17080644editdlrm
__init__.cpython-39.opt-1.pyc38420644editdlrm
__init__.cpython-39.opt-2.pyc31630644editdlrm
__init__.cpython-39.pyc38420644editdlrm
Edit: /opt/imh-python/lib/python3.9/importlib/__pycache__/resources.cpython-39.pyc (6400B)
a bh)@sddlZddlmZddlmZddlmZddlmZmZddl m Z ddl m Z dd l mZmZdd lmZdd lmZdd lmZmZmZmZdd lmZddlmZmZgdZeeefZeeej fZ!edddZ"edddZ#edddZ$eeej%dddZ&ddZ'ee!edddZ(d4ee!eeed!d"d#Z)ee!e*dd$d%Z+d5ee!eeed!d&d'Z,eej-dd(d)Z.ee!d*dd+d,Z/ed-d.Z0eee1d/d0d1Z2eeedd2d3Z3dS)6N)abc)_common)as_file)contextmanagersuppress) import_module)ResourceLoader)BytesIO TextIOWrapper)Path) ModuleType)ContextManagerIterableOptionalUnion)cast)BinaryIOTextIO) PackageResourcercontentsfiles is_resource open_binary open_textpath read_binary read_text)returncCst|dr|St|S)z)If name is a string, resolve to a module.__spec__)hasattrrnamer$4/opt/imh-python/lib/python3.9/importlib/resources.py_resolve$s r&cCs&t|}|jjdur"td||S)zTake a package name or module object and return the module. If a name, the module is imported. If the resolved module object is not a package, raise an exception. Nz{!r} is not a package)r&r submodule_search_locations TypeErrorformat)packagemoduler$r$r% _get_package+s r,cCs&tj|\}}|r"td||S)zNormalize a path by ensuring it is a string. If the resulting string contains path separators, an exception is raised. z{!r} must be only a file name)osrsplit ValueErrorr))rparent file_namer$r$r%_normalize_path7sr2)r*rcCs,|j}t|jdr(ttj|j|jSdS)Nget_resource_reader)r r!loaderr resources_abcResourceReaderr3r#)r*specr$r$r%_get_resource_readerBs   r8cCs&|jjdus|jjs"td|dS)NzPackage has no location )r origin has_locationFileNotFoundErrorr*r$r$r%_check_locationPsr=)r*resourcerc Cst|}t|}t|}|dur*||Stj|jjp:d}tj |}tj ||}zt |ddWSt yt t|jj}d}t|jjdrtt ||}Wdn1s0Y|dur|jj}d||} t| t|YS0dS)zDReturn a file-like object opened for binary reading of the resource.Nznon-existent filerb)modeget_dataz{!r} resource not found in {!r})r2r,r8 open_resourcer-rabspathr r9dirnamejoinopenOSErrorrr r4r!rrAr#r)r;r ) r*r>readerZabsolute_package_path package_path full_pathr4dataZ package_namemessager$r$r%rUs2     (rutf-8strict)r*r>encodingerrorsrcCstt||||dS)zBReturn a file-like object opened for text reading of the resource.)rOrP)r r)r*r>rOrPr$r$r%rss rcCs6t||}|WdS1s(0YdS)z+Return the binary contents of the resource.N)rread)r*r>fpr$r$r%r|s rcCs:t||||}|WdS1s,0YdS)zReturn the decoded string of the resource. The decoding-related arguments have the same semantics as those of bytes.decode(). N)rrQ)r*r>rOrPrRr$r$r%rs rcCstt|S)z3 Get a Traversable resource from a package )r from_packager,r<r$r$r%rsrzContextManager[Path]cCs2tt|}|rt||Stt|t|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). )r8r,_path_from_readerrrrjoinpathr2)r*r>rHr$r$r%rs  rccst|}tt"t||VWddS1s80Y||}tj|j|d}|VWdn1sx0YdS)N)suffix) r2rr;r resource_pathrBrZ _tempfilerQ)rHr>Z norm_resourceZ opener_readerresr$r$r%rTs   rT)r*r#rcCsTt|}t|t|}|dur*||Stt|}||vrBdSt||S)zYTrue if 'name' is a resource inside 'package'. Directories are *not* resources. NF) r,r2r8rsetrrrSis_file)r*r#rHZpackage_contentsr$r$r%rs  rcCsdt|}t|}|dur |S|jjdup6|jjdk}|sD|jjsHdStddt| 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. N namespacer$css|] }|jVqdS)Nr").0itemr$r$r% zcontents..) r,r8rr r9r:listrrSiterdir)r*rHr[r$r$r%rs   r)rMrN)rMrN)4r-rr5rr contextlibrr importlibr importlib.abcr ior r pathlibr typesr typingrrrrrZ typing.iorr__all__strrPathLikerr&r,r2r6r8r=rrbytesrr TraversablerrrTboolrrr$r$r$r%sZ