Viewing File: /opt/alt/python311/lib64/python3.11/importlib/resources/__pycache__/_common.cpython-311.pyc



fKXddlZddlZddlZddlZddlZddlZddlZddlmZm	Z	ddl
mZmZddl
mZeejefZdZdZdZd	Zd
Zejdejdd
ZejdZeejejdZdS)N)UnionOptional)ResourceReaderTraversable)	wrap_specc:tt|S)z3
    Get a Traversable resource from a package
    )from_packageget_package)packages B/opt/alt/python311/lib64/python3.11/importlib/resources/_common.pyfilesrs
G,,---cd|j}t|jdd}|dS||jS)z?
    Return the package's loader if it's a ResourceReader.
    get_resource_readerN)__spec__getattrloadernamerspecreaders   r
rrs<D
T["7
>
>F
~t6$)rcbt|tjr|ntj|S)N)
isinstancetypes
ModuleType	importlib
import_module)cands r
resolver *s*dE$455X449;RSW;X;XXrcpt|}t|jt|d|S)zTake a package name or module object and return the module.

    Raise an exception if the resolved module is not a package.
    Nz is not a package)r rsubmodule_search_locations	TypeError)rresolveds  r
rr/s>wH5=7777888Orct|}|j|j}|S)z=
    Return a Traversable object for the given package.

    )rrrrrrs   r
r
r
;s6
WD
[
,
,TY
7
7F<<>>r)
_os_removec#~Ktj|\}}		tj||tj|n#tj|wxYw~tj|V	||dS#t$rYdSwxYw#	||w#t$rYwwxYwxYw)Nsuffix)tempfilemkstemposwriteclosepathlibPathFileNotFoundError)rr*r'fdraw_paths     r
	_tempfiler5Es#6222LB	HR"""HRLLLLBHRLLLLl8$$$$$	Jx      			DD		Jx     			D	sRABA%%BB

BBB< B,+B<,
B96B<8B99B<c8t|j|jS)zu
    Given a Traversable object, return that object as a
    path on the local file system in a context manager.
    r))r5
read_bytesrpaths r
as_filer:\sT_TY7777rc#K|VdS)z7
    Degenerate behavior for pathlib.Path objects.
    Nr8s r
_r=esJJJJJr)r&)r-r0r+	functools
contextlibrrtypingrrabcrr	_adaptersrrstrPackagerrr rr
contextmanagerremover5singledispatchr:registerr1r=r<rr
<module>rIs				"""""""",,,,,,,,      
 #%
&..."YYY
			I,888	', r
Back to Directory File Manager