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



fb
RdZdaddlZddlZddlZddlZddlZejdkZer	ddl	Z
ddlZnddlZ
erddgZ
ndgZ
ede
DsJe
dZee
Zde
Z
de
DZd	Zd
ZeezZdZeZdZd
ZdZerdZndZdZdZdZdZ dZ!erdZ"ndZ"dOdZ#e$e#j%Z&d'dddzZ(e)*e(dZ+dZ,dZ-d gZ.ere./d!ej0Z1d"gZ2e2xZ3Z4dPdd#d$Z5d%Z6d&Z7d'Z8d(Z9d)Z:d*Z;d+Z<d,Z=d-Z>dQd.Z?dRd/Z@dSd1ZAd2ZBeCZDdPdeDd3d4ZEGd5d6ZFGd7d8ZGGd9d:eGZHGd;d<ZIGd=d>eIeHZJGd?d@eIeGZKGdAdBeIeGZLGdCdDZMGdEdFZNeNZOGdGdHZPGdIdJZQdPdKZRdLZSdMZTdNZUdS)Ta^Core implementation of path-based import.

This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public-facing version of this module.

Nwin32\/c#<K|]}t|dkVdS)N)len).0seps  D/opt/alt/python311/lib64/python3.11/importlib/_bootstrap_external.py	<genexpr>r.s,
4
4S3s88q=
4
4
4
4
4
4ch|]}d|S):)r	ss  r	<setcomp>r2s999AA999r
)win)cygwindarwinctjtr/tjtrdndfd}nd}|S)NPYTHONCASEOKsPYTHONCASEOKcDtjjo
tjvS)z^True if filenames must be checked case-insensitively and ignore environment flags are not set.)sysflagsignore_environment_osenvironkeysr_relax_casez%_make_relax_case.<locals>._relax_caseCsy33Js{8JJr
cdS)z5True if filenames must be checked case-insensitively.Frrr
rr!z%_make_relax_case.<locals>._relax_caseGs5r
)rplatform
startswith_CASE_INSENSITIVE_PLATFORMS#_CASE_INSENSITIVE_PLATFORMS_STR_KEY)r!r s @r_make_relax_caser'<s|
|:;;<""#FGG	" CC!C	K	K	K	K	K	K			r
cNt|dzddS)z*Convert a 32-bit integer to little-endian.little)intto_bytes)xs r_pack_uint32r/Os#FFZ))!X666r
cbt|dksJt|dS)z/Convert 4 bytes in little-endian to an integer.r*r+rr,
from_bytesdatas r_unpack_uint32r5T)t99>>>>>>$)))r
cbt|dksJt|dS)z/Convert 2 bytes in little-endian to an integer.r+r1r3s r_unpack_uint16r9Yr6r
c|sdSt|dkr|dSd}g}ttj|D]\}}|t
s|t
r(|tp|}t|zg}a|drF|
|
kr|}|g}|||p|}||d|D}t|dkr|ds
|tzS|t|zS)Replacement for os.path.join().rrrrcFg|]}||tSrrstrippath_separators)r	ps  r
<listcomp>z_path_join.<locals>.<listcomp>ws)===a1=))===r
)
rmapr_path_splitrootr$path_sep_tupleendswithr>r?path_sepcasefoldappendjoin)
path_partsrootpathnew_roottails     r
_path_joinrO`sg	2z??aa= !#"5zBB	"	"NHd"">22

"h6G6G6W6W

"77?4 4(""3''

"==??h&7&7&9&999$D 6DDKK%%%%'4D!!!!==4===t99>>$q'>(?"hmmD))))r
cJtd|DS)r;cFg|]}||tSrr=)r	parts  rrAz_path_join.<locals>.<listcomp>s8>>>"&>dkk/::>>>r
)rFrI)rJs rrOrO~s4}}>>*4>>>??	?r
ctfdtD}|dkrdfSd||dzdfS)z Replacement for os.path.split().c3BK|]}|VdSN)rfind)r	r@rLs  rrz_path_split.<locals>.<genexpr>s-33aDJJqMM333333r
rrNr)maxr?)rLis` r_path_splitrYsV3333?33333A1uu4x8T!a%&&\!!r
c*tj|S)z~Stat the path.

    Made a separate function to make it easier to override in experiments
    (e.g. cache stat results).

    )rstatrLs r
_path_statr]s8D>>r
cb	t|}n#t$rYdSwxYw|jdz|kS)z1Test whether the path is the specified mode type.Fi)r]OSErrorst_mode)rLmode	stat_infos   r_path_is_mode_typercsKt$$		uu(T11s
  c"t|dS)zReplacement for os.path.isfile.i)rcr\s r_path_isfileresdH---r
cL|stj}t|dS)zReplacement for os.path.isdir.i@)rgetcwdrcr\s r_path_isdirrhs%z||dH---r
c|sdStj|ddd}t|dko)|dp|dS)Replacement for os.path.isabs.Frrrrz\\)rrCreplacerr$rE)rLrKs  r_path_isabsrlsf	5"4((+33C>>4yy1}Q$//&"9"9"PT]]4=P=PQr
c6|tS)rj)r$r?r\s rrlrls///r
cd|t|}tj|tjtjztjz|dz}	tj|d5}|	|dddn#1swxYwYtj
||dS#t$r(	tj|n#t$rYnwxYwwxYw)zBest-effort function to write data to a path atomically.
    Be prepared to handle a FileExistsError if concurrent writing of the
    temporary file is attempted.{}.{}rnwbN)
formatidropenO_EXCLO_CREATO_WRONLY_ioFileIOwriterkr_unlink)rLr4rapath_tmpfdfiles      r
_write_atomicrs6
~~dBtHH--H	(*s{*S\94%<
I
IBZD
!
!	TJJt															Hd#####	Jx    			D	
sT"B;7B
B;BB; B!B;;
C-CC-
C(%C-'C((C-i
r8r+s
__pycache__zopt-z.pyz.pywz.pyc)optimizationc|3tjdt|d}t||rdnd}t	j|}t
|\}}|d\}}}tj	j
}	|	tdd|r|n|||	g}
|)tj
jdkrd}ntj
j}t|}|dkrR|s"t#d	|d
|
t&|}
|
t(dz}tjt-|s!t/t	j|}|ddkr|dt2vr
|dd}t/tj|t2|St/|t6|S)
aGiven the path to a .py file, return the path to its .pyc file.

    The .py file does not need to exist; this simply returns the path to the
    .pyc file calculated as if the .py file were imported.

    The 'optimization' parameter controls the presumed optimization level of
    the bytecode file. If 'optimization' is not None, the string representation
    of the argument is taken and verified to be alphanumeric (else ValueError
    is raised).

    The debug_override parameter is deprecated. If debug_override is not None,
    a True value is the same as setting 'optimization' to the empty string
    while a False value is equivalent to setting 'optimization' to '1'.

    If sys.implementation.cache_tag is None then NotImplementedError is raised.

    NzFthe debug_override parameter is deprecated; use 'optimization' insteadz2debug_override or optimization must be set to Nonerr.$sys.implementation.cache_tag is Nonerz{!r} is not alphanumericz{}.{}{}rr8)	_warningswarnDeprecationWarning	TypeErrorrfspathrY
rpartitionrimplementation	cache_tagNotImplementedErrorrIroptimizestrisalnum
ValueErrorrr_OPTBYTECODE_SUFFIXESpycache_prefixrlrOrgr?lstrip_PYCACHE)rLdebug_overridermessageheadrNbaser
resttagalmost_filenamefilenames            rcache_from_sourcers$!01C	E	E	E#JGG$$$+2rr:dDT""JD$ooc**OD#t


&C
{!"HIIIgg 6$cBCCO9""LL9-L|$$Lr##%%	N7>>|LLMMM#**?D,OO!21!55H
%4  	2cjllD11D
7c>>d1g_<<8DKK((

	

dHh///r
ctjjtdt	j|}t
|\}}d}tjZtjt}|
|tzr|t|d}d}|s6t
|\}}|tkrttd||d}|dvrtd||d	kr|dd
d}|
t"stdt"|tt"d}|std
|d|dd}	t)||	t*dzS)anGiven the path to a .pyc. file, return the path to its .py file.

    The .pyc file does not need to exist; this simply returns the path to
    the .py file calculated to correspond to the .pyc file.  If path does
    not conform to PEP 3147/488 format, ValueError will be raised. If
    sys.implementation.cache_tag is None then NotImplementedError is raised.

    NrFTz not bottom-level directory in r>r8zexpected only 2 or 3 dots in rr8z5optimization portion of filename does not start with zoptimization level z is not an alphanumeric valuer)rrrrrrrYrr>r?r$rFrrrcountrsplitrr	partitionrOSOURCE_SUFFIXES)
rLrpycache_filenamefound_in_pycache_prefix
stripped_pathpycache	dot_countr	opt_level
base_filenames
          rsource_from_cachers#+!"HIII:dD(..D
#
%*11/BB
??=8344	+M**++,D&*#"*#D))
gh)) $))**
* &&s++IM9IMMNNN	a'..sA66r:&&t,,	/.%)..//
/ T,	  ""	32<22233
3$..s33A6MdMOA,>>???r
c0t|dkrdS|d\}}}|r |dddkr|S	t|}n!#tt
f$r
|dd}YnwxYwt
|r|n|S)zConvert a bytecode file path to a source path (if possible).

    This function exists purely for backwards-compatibility for
    PyImport_ExecCodeModuleWithFilenames() in the C API.

    rNrpy)rrlowerrrrre)
bytecode_pathr_	extensionsource_paths     r_get_sourcefiler$s=Qt&11#66D!Y9??$$RU+t33)'
66,)))#CRC()&{33F;;FsA$$BBc|ttr!	t|S#t$rYdSwxYw|tt
r|SdSrU)rEtuplerrrr)rs r_get_cachedr7s~//00	$X..."			DD				5!233	4	4ts8
AAc`	t|j}n#t$rd}YnwxYw|dz}|S)z3Calculate the mode permissions for a bytecode file.rn)r]r`r_)rLras  r
_calc_moderCsM$'	EMDKs&&cZdfd	}t
tj}nd}|||S)zDecorator to verify that the module being requested matches the one the
    loader can handle.

    The first argument (self) must define _name which the second argument is
    compared against. If the comparison fails then ImportError is raised.

    Nc||j}n'|j|krtd|jd||||g|Ri|S)Nzloader for z cannot handle name)rImportError)selfrargskwargsmethods    r_check_name_wrapperz(_check_name.<locals>._check_name_wrapperWsn<9DD
Y$

+!%DD28<>>>
>vdD242226222r
c	dD]1}t||rt||t||2|j|jdS)N)
__module____name____qualname____doc__)hasattrsetattrgetattr__dict__update)newoldrks   r_wrapz_check_name.<locals>._wrapdsaP
A
A3((AC'#w*?*?@@@L-----r
rU)
_bootstrapr)rrrs`  r_check_namerOs]333333 	.	.	.
E
v&&&r
ctjdt||\}}|Dt	|r5d}tj||dt|S)zTry to find a loader for the specified module by delegating to
    self.find_loader().

    This method is deprecated in favor of finder.find_spec().

    zZfind_module() is deprecated and slated for removal in Python 3.12; use find_spec() insteadNz,Not importing directory {}: missing __init__r)rrrfind_loaderrrr
ImportWarning)rfullnameloaderportionsmsgs     r_find_module_shimrnsvNP%'''''11FH
~#h--~<szz(1+..
>>>Mr
cv|dd}|tkr0d|d|}td|t|fi|t	|dkr/d|}td|t|t
|dd}|d	zrd
|d|}t|fi||S)aTPerform basic validity checking of a pyc header and return the flags field,
    which determines how the pyc should be further validated against the source.

    *data* is the contents of the pyc file. (Only the first 16 bytes are
    required, though.)

    *name* is the name of the module being imported. It is used for logging.

    *exc_details* is a dictionary passed to ImportError if it raised for
    improved debugging.

    ImportError is raised when the magic number is incorrect or when the flags
    field is invalid. EOFError is raised when the data is found to be truncated.

    Nr*zbad magic number in z: {}z(reached EOF while reading pyc header of zinvalid flags z in )MAGIC_NUMBERr_verbose_messagerrEOFErrorr5)r4rexc_detailsmagicrrs      r
_classify_pycrs 
!HE<<<5<<##D'222'11[111
4yy2~~ETEE##D'222w4!9%%Eu}2858888'11[111Lr
ct|dd|dzkr-d|}td|t|fi||.t|dd|dzkrtd|fi|dSdS)aValidate a pyc against the source last-modified time.

    *data* is the contents of the pyc file. (Only the first 16 bytes are
    required.)

    *source_mtime* is the last modified timestamp of the source file.

    *source_size* is None or the size of the source file in bytes.

    *name* is the name of the module being imported. It is used for logging.

    *exc_details* is a dictionary passed to ImportError if it raised for
    improved debugging.

    An ImportError is raised if the bytecode is stale.

    rr)zbytecode is stale for rNr)r5rrr)r4source_mtimesource_sizerrrs      r_validate_timestamp_pycrs&d1R4j!!lZ&?@@3433##D'222'11[111tBrE{##j(@AA;4;;KK{KKK	 AAr
cB|dd|krtd|fi|dS)aValidate a hash-based pyc by checking the real source hash against the one in
    the pyc header.

    *data* is the contents of the pyc file. (Only the first 16 bytes are
    required.)

    *source_hash* is the importlib.util.source_hash() of the source file.

    *name* is the name of the module being imported. It is used for logging.

    *exc_details* is a dictionary passed to ImportError if it raised for
    improved debugging.

    An ImportError is raised if the bytecode is stale.

    rrz.hash in bytecode doesn't match hash of source N)r)r4source_hashrrs    r_validate_hash_pycrsI"AbDz[  FdFF



	
! r
ctj|}t|tr4td||t
j|||Std	|||)z#Compile bytecode as found in a pyc.zcode object from {!r}NzNon-code object in {!r}rrL)
marshalloads
isinstance
_code_typerr_imp_fix_co_filenamerrr)r4rrrcodes     r_compile_bytecoders=D$
##9##$;]KKK"!$4443::=II#-999	9r
cHtt}|td|t||t||t	j||S)z+Produce the data for a timestamp-based pyc.r)	bytearrayrextendr/rdumps)rmtimerr4s    r_code_to_timestamp_pycrs|\""DKKQ   KKU##$$$KK[))***KK
d##$$$Kr
Tc$tt}d|dzz}|t|t	|dksJ|||tj||S)z&Produce the data for a hash-based pyc.rr)rrrr/rrr)rrcheckedr4rs     r_code_to_hash_pycrs\""D'Q,EKKU##$$${q    KKKK
d##$$$Kr
cddl}tj|j}||}tjdd}|||dS)zyDecode bytes representing source code and return the string.

    Universal newline support is used in the decoding.
    rNT)tokenizerxBytesIOreadlinedetect_encodingIncrementalNewlineDecoderdecode)source_bytesrsource_bytes_readlineencodingnewline_decoders     r
decode_sourcersl
OOOK55>''(=>>H3D$??O!!,"5"5hqk"B"BCCCr
rsubmodule_search_locationsc*|:d}t|dr'	||}ng#t$rYn[wxYwnVtj|}t|s3	t
tj|}n#t$rYnwxYwt
|||}d|_|MtD]<\}}|
t|r|||}||_n=dS|t urAt|dr0	||}|rg|_n#t$rYnwxYwn||_|jgkr1|r/t'|d}|j||S)a=Return a module spec based on a file location.

    To indicate that the module is a package, set
    submodule_search_locations to a list of directory paths.  An
    empty list is sufficient, though its not otherwise useful to the
    import system.

    The loader must take a spec as its only __init__() arg.

    Nz	<unknown>get_filenameoriginT
is_packager)rrrrrrlrOrgr_r
ModuleSpec
_set_fileattr_get_supported_file_loadersrErr	_POPULATErrrYrH)	rlocationrrspecloader_classsuffixesrdirnames	         rspec_from_file_locationr"
s	6>**	
!..t44



		:h''8$$	
%cjllH==



  vh ??DD~&A&C&C		"L(  x11
%dH55$

4"Y..6<((	9
9#..t44
968D3	



	9+E'&",,	<!(++A.G+227;;;Ks0,
99!!B
BB D??
EEceZdZdZdZdZeodevZe	dZ
edZed
dZ
edd	ZdS)WindowsRegistryFinderz>Meta path finder for modules declared in the Windows registry.z;Software\Python\PythonCore\{sys_version}\Modules\{fullname}zASoftware\Python\PythonCore\{sys_version}\Modules\{fullname}\Debugz_d.pydc	tjtj|S#t$r"tjtj|cYSwxYwrU)winregOpenKeyHKEY_CURRENT_USERr_HKEY_LOCAL_MACHINErs r_open_registryz$WindowsRegistryFinder._open_registry_sW	B>&":C@@@	B	B	B>&";SAAAAA	Bs!)A
A
c4|jr|j}n|j}||dtjddz}	||5}tj|d}dddn#1swxYwYn#t$rYdSwxYw|S)Nz%d.%dr8)rsys_versionr)
DEBUG_BUILDREGISTRY_KEY_DEBUGREGISTRY_KEYrrrversion_infor*r&
QueryValuer_)clsrregistry_keyr hkeyfilepaths      r_search_registryz&WindowsRegistryFinder._search_registryfs?	,1LL+L!!8.58H!8L.L"NN	##C((
7D!,T266
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7			44	s6BA;/B;A??BA?B
BBNc>||}|dS	t|n#t$rYdSwxYwtD]R\}}|t|r+t|||||}|cSSdS)Nr)r6r]r_rrErrspec_from_loader)r2rrLtargetr5rr rs        r	find_speczWindowsRegistryFinder.find_specus''114	x    			44	 ; = =		FH  x11
!228396(H3M3M:B3DD	
		s+
99cxtjdt|||}||jSdS)zjFind module named in the registry.

        This method is deprecated.  Use find_spec() instead.

        zpWindowsRegistryFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() insteadNrrrr:rr2rrLrs    rfind_modulez!WindowsRegistryFinder.find_modulesI	T)	+	+	+}}Xt,,;4r
NNrU)rrrrr/r._MS_WINDOWSEXTENSION_SUFFIXESr-staticmethodr*classmethodr6r:r>rr
rr$r$SsHH	 	'A8/A#AKBB\B[


[



[


r
r$c*eZdZdZdZdZdZdZdS)
_LoaderBasicszSBase class of common code needed by both SourceLoader and
    SourcelessFileLoader.ct||d}|ddd}|dd}|dko|dkS)zConcrete implementation of InspectLoader.is_package by checking if
        the path returned by get_filename has a filename of '__init__.py'.rrrr8__init__)rYrrr)rrr
filename_base	tail_names     rrz_LoaderBasics.is_packagesit00::;;A> Q//2
'',,Q/	
*FyJ/FFr
cdSz*Use default semantics for module creation.Nrrrs  r
create_modulez_LoaderBasics.create_moduler
c||j}|'td|jtt||jdS)zExecute the module.Nz4cannot load module {!r} when get_code() returns None)get_coderrrrr_call_with_frames_removedexecr)rmodulers   rexec_modulez_LoaderBasics.exec_modulesc}}V_--<--3VFO-D-DFF
F,,T4IIIIIr
c8t||S)zThis method is deprecated.)r_load_module_shimrrs  rload_modulez_LoaderBasics.load_modules++D(;;;r
N)rrrrrrMrTrXrr
rrErEs`GGG999JJJ<<<<<r
rEc>eZdZdZdZdZdZdZdddZd	Z	d
S)SourceLoaderct)zOptional method that returns the modification time (an int) for the
        specified path (a str).

        Raises OSError when the path cannot be handled.
        )r_rrLs  r
path_mtimezSourceLoader.path_mtimes	
r
c0d||iS)aOptional method returning a metadata dict for the specified
        path (a str).

        Possible keys:
        - 'mtime' (mandatory) is the numeric timestamp of last source
          code modification;
        - 'size' (optional) is the size in bytes of the source code.

        Implementing this method allows the loader to read bytecode files.
        Raises OSError when the path cannot be handled.
        r)r]r\s  r
path_statszSourceLoader.path_statss..//r
c.|||S)zOptional method which writes data (bytes) to a file path (a str).

        Implementing this method allows for the writing of bytecode files.

        The source path is needed in order to correctly transfer permissions
        )set_data)rr
cache_pathr4s    r_cache_bytecodezSourceLoader._cache_bytecodes}}Z...r
cdS)zOptional method which writes data (bytes) to a file path (a str).

        Implementing this method allows for the writing of bytecode files.
        Nr)rrLr4s   rrazSourceLoader.set_datarNr
c||}	||}n$#t$r}td||d}~wwxYwt	|S)z4Concrete implementation of InspectLoader.get_source.z'source not available through get_data()rN)rget_datar_rr)rrrLr
excs     r
get_sourcezSourceLoader.get_sources|  **	6==..LL	6	6	6G#+---25
6	6\***s-
AA		Ar)	_optimizecLtt||dd|S)zReturn the code object compiled from source.

        The 'data' argument can be any object type that compile() supports.
        rRT)dont_inheritr)rrQcompile)rr4rLris    rsource_to_codezSourceLoader.source_to_codes1
33GT459I4OO	Or
c||}d}d}d}d}d}	t|}	||}	t|	d}	||}
||d}	t|
||}t
|
dd}
|dzdk}|rm|d	zdk}tjd
krS|stjdkrA||}tj	t|}t|
|||nt|
||	d||td
||t|
|||S#t t"f$rYn6wxYw#t$$rYn&wxYw#t$$rYnwxYw#t&$rd}YnwxYw|||}|||}td|t*jsu|s|q|r(|tj	|}t/|||}
nt1||t3|}
	||||
n#t&$rYnwxYw|S)zConcrete implementation of InspectLoader.get_code.

        Reading of bytecode requires path_stats to be implemented. To write
        bytecode, set_data must also be implemented.

        NFTrrrrrr8neveralwayssizez
{} matches {})rrrzcode object from {})rrr_r,rfr
memoryviewrcheck_hash_based_pycsr_RAW_MAGIC_NUMBERrrrrrrrr_rrmrdont_write_bytecoderrrrc)rrrrr
r
hash_basedcheck_sourcerstr4rr
bytes_datacode_objects               rrPzSourceLoader.get_codesM''11
3	J-k::M.
J__[11 #2g;//(J==77D
!) -##KJ -dHk J J%/%5%5bcc%:
%*S[A%5
%+04<1+<L $ :g E E!-!F!%!;x!G!G/3}}[/I/I.2.>$5$0/"/"!34h3>!@!@!@4 $ , "6
 ( +#33O]4?AAA0(?L=H J J JJ(2?D




#	!	!	! MMM	!d==55L)),DD##$9;GGG'	M,E(
A&"&"2<"@"@K(k<PP-k<.1,.?.?AA
$$[-FFFF&



sYFFE67B9EE32E36
FF
FFF%$F%	I!!
I.-I.N)
rrrr]r_rcrarhrmrPrr
rrZrZs000///+++79OOOOORRRRRr
rZcveZdZdZdZdZdZefdZedZ	dZ
edZxZS)	
FileLoaderzgBase file loader class which implements the loader protocol methods that
    require file system usage.c"||_||_dS)zKCache the module name and the path to the file found by the
        finder.Nr)rrrLs   rrGzFileLoader.__init__Is				r
cB|j|jko|j|jkSrU	__class__rrothers  r__eq__zFileLoader.__eq__O$%/10
/	1r
cTt|jt|jzSrUhashrrLrs r__hash__zFileLoader.__hash__SDIdi00r
cTtt||S)zdLoad a module from a file.

        This method is deprecated.  Use exec_module() instead.

        )superr|rX)rrrs  rrXzFileLoader.load_moduleVs#Z&&228<<<r
c|jSz:Return the path to the source file as found by the finder.r\rWs  rrzFileLoader.get_filenamebyr
c^t|ttfrOtjt|5}|cdddS#1swxYwYdStj|d5}|cdddS#1swxYwYdS)z'Return the data from path as raw bytes.Nr)rrZExtensionFileLoaderrx	open_coderreadry)rrLr~s   rrfzFileLoader.get_datagsd\+>?@@	#s4yy))
#Tyy{{
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#D#&&
#$yy{{
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#s#AA#&A#B""B&)B&c$ddlm}||S)Nr)
FileReader)importlib.readersr)rrSrs   rget_resource_readerzFileLoader.get_resource_readerps$000000z$r
)
rrrrrGrrrrXrrfr
__classcell__)rs@rr|r|Ds""111111	=	=	=	=[	=[###  [     r
r|c*eZdZdZdZdZdddZdS)SourceFileLoaderz>Concrete implementation of SourceLoader using the file system.c>t|}|j|jdS)z!Return the metadata for the path.)rrq)r]st_mtimest_size)rrLrxs   rr_zSourceFileLoader.path_statszs!


bj999r
cPt|}||||S)N_mode)rra)rrrr4ras     rrcz SourceFileLoader._cache_bytecodes'+&&}}]D}===r
rnrcpt|\}}g}|rGt|s8t|\}}|||rt|8t|D]g}t	||}	tj|(#t$rY4t$r(}t
d||Yd}~dSd}~wwxYw	t|||t
d|dS#t$r'}t
d||Yd}~dSd}~wwxYw)zWrite bytes data to a file.zcould not create {!r}: {!r}Nzcreated {!r})rYrhrHreversedrOrmkdirFileExistsErrorr_rrr)	rrLr4rparentrrJrRrgs	         rrazSourceFileLoader.set_datas&t,,
	$[00	$&v..LFDd###	$[00	$Z((		D--F

	&!!!!"





++,I,2C999
	-$e,,,''=====	-	-	-''(Et(+
-
-
-
-
-
-
-
-
-	-s6B
C!	C*C

C,D
D5D00D5N)rrrrr_rcrarr
rrrvsVHH:::
>>>
-2-------r
rceZdZdZdZdZdS)SourcelessFileLoaderz-Loader which handles sourceless file imports.c||}||}||d}t|||tt	|dd||S)Nrr)rr)rrfrrrr)rrrLr4rs     rrPzSourcelessFileLoader.get_codes  **}}T""

	dHk222 tRSS!


	
r
cdS)z'Return None as there is no source code.NrrWs  rrhzSourcelessFileLoader.get_sourcetr
N)rrrrrPrhrr
rrrs877


 r
rcXeZdZdZdZdZdZdZdZdZ	dZ
d	Zed
Z
dS)rz]Loader for extension modules.

    The constructor is designed to work with FileFinder.

    c"||_||_dSrUr)rrrLs   rrGzExtensionFileLoader.__init__s				r
cB|j|jko|j|jkSrUrrs  rrzExtensionFileLoader.__eq__rr
cTt|jt|jzSrUrrs rrzExtensionFileLoader.__hash__rr
cttj|}td|j|j|S)z(Create an uninitialized extension modulez&extension module {!r} loaded from {!r})rrQrcreate_dynamicrrrL)rrrSs   rrMz!ExtensionFileLoader.create_modulesH55''##$LDI	/	/	/
r
cttj|td|j|jdS)zInitialize an extension modulez(extension module {!r} executed from {!r}N)rrQrexec_dynamicrrrLrrSs  rrTzExtensionFileLoader.exec_modulesI,,T->GGG##$NDI	/	/	/	/	/r
cxt|jdtfdtDS)z1Return True if the extension module is a package.rc3*K|]
}d|zkVdS)rGNr)r	suffix	file_names  rrz1ExtensionFileLoader.is_package.<locals>.<genexpr>sA55
V 33555555r
)rYrLanyrA)rrrs  @rrzExtensionFileLoader.is_packagesO	**1-	5555!355555	5r
cdS)z?Return None as an extension module cannot create a code object.NrrWs  rrPzExtensionFileLoader.get_coderr
cdS)z5Return None as extension modules have no source code.NrrWs  rrhzExtensionFileLoader.get_sourcerr
c|jSrr\rWs  rrz ExtensionFileLoader.get_filenamerr
N)rrrrrGrrrMrTrrPrhrrrr
rrrs111111///555[r
rcXeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdS)_NamespacePatha&Represents a namespace package's path.  It uses the module name
    to find its parent module, and from there it looks up the parent's
    __path__.  When this changes, the module's own path is recomputed,
    using path_finder.  For top-level modules, the parent module's path
    is sys.path.rc||_||_t||_|j|_||_dSrU)_name_pathr_get_parent_path_last_parent_path_epoch_last_epoch_path_finderrrrLpath_finders    rrGz_NamespacePath.__init__sD

!&t'<'<'>'>!?!?;'r
cV|jd\}}}|dkrdS|dfS)z>Returns a tuple of (parent-module-name, parent-path-attr-name)rr)rrL__path__)rr)rrdotmes    r_find_parent_path_namesz&_NamespacePath._find_parent_path_namess8*//44R"99 =z!!r
cp|\}}ttj||SrU)rrrmodules)rparent_module_namepath_attr_names   rrz_NamespacePath._get_parent_path
s1-1-I-I-K-K*Ns{#56GGGr
ct|}||jks|j|jkrJ||j|}||j|jr|j|_	||_|j|_|j	SrU)
rrrrrrrrrr)rparent_pathrs   r_recalculatez_NamespacePath._recalculatesD113344$000DK4CS4S4S$$TZ==DDK$72A!%!@DJ%0D"#{Dzr
cDt|SrU)iterrrs r__iter__z_NamespacePath.__iter__sD%%''(((r
c6||SrUr)rindexs  r__getitem__z_NamespacePath.__getitem__"s  ""5))r
c||j|<dSrU)r)rrrLs   r__setitem__z_NamespacePath.__setitem__%s 
5r
cDt|SrU)rrrs r__len__z_NamespacePath.__len__(s4$$&&'''r
c6d|jS)Nz_NamespacePath({!r}))rrrrs r__repr__z_NamespacePath.__repr__+s%,,TZ888r
c.||vSrUrritems  r__contains__z_NamespacePath.__contains__.st((****r
c:|j|dSrU)rrHrs  rrHz_NamespacePath.append1s
$r
N)rrrrrrGrrrrrrrrrrHrr
rrrsF((("""HHH)))***!!!(((999+++     r
rcTeZdZdZedZdZdZdZdZ	dZ
dZd	Zd
S)NamespaceLoaderc2t||||_dSrU)rrrs    rrGzNamespaceLoader.__init__9s#D$<<


r
cjtjdtd|jS)zsReturn repr for the module.

        The method is deprecated.  The import machinery does the job itself.

        zQNamespaceLoader.module_repr() is deprecated and slated for removal in Python 3.12z<module {!r} (namespace)>)rrrrrr)rSs rmodule_reprzNamespaceLoader.module_repr<s9	;<N	P	P	P*11&/BBBr
cdS)NTrrWs  rrzNamespaceLoader.is_packageGstr
cdS)NrrrWs  rrhzNamespaceLoader.get_sourceJsrr
c(tddddS)Nrz<string>rRT)rk)rlrWs  rrPzNamespaceLoader.get_codeMsr:vDAAAAr
cdSrKrrLs  rrMzNamespaceLoader.create_modulePrNr
cdSrUrrs  rrTzNamespaceLoader.exec_moduleSsr
cxtd|jt||S)zbLoad a namespace module.

        This method is deprecated.  Use exec_module() instead.

        z&namespace module loaded with path {!r})rrrrVrWs  rrXzNamespaceLoader.load_moduleVs<	##$L$(J	0	0	0++D(;;;r
c.ddlm}||jS)Nr)NamespaceReader)rrr)rrSrs   rrz#NamespaceLoader.get_resource_readerbs&555555tz***r
N)
rrrrGrBrrrhrPrMrTrXrrr
rrr8s===CC\CBBB999



<
<
<+++++r
rceZdZdZedZedZedZedZ	eddZ
eddZedd	Zed
Z
dS)
PathFinderz>Meta path finder for sys.path and package __path__ attributes.cLttjD]H\}}|t	|stj|=$t|dr|Itxjdz
c_ddl	m
}|dS)z}Call the invalidate_caches() method on all path entry finders
        stored in sys.path_importer_caches (where implemented).Ninvalidate_cachesrrMetadataPathFinder)listrpath_importer_cacheitemsrlrrrrimportlib.metadatar)rfinderrs   rrzPathFinder.invalidate_cachesqs!!8!>!>!@!@AA	+	+LD&~[%6%6~+D11!455
+((***	"999999,,.....r
ctj&tjstjdttjD]}	||cS#t
$rYwxYwdS)z.Search sys.path_hooks for a finder for 'path'.Nzsys.path_hooks is empty)r
path_hooksrrrr)rLhooks  r_path_hookszPathFinder._path_hookssw>%cn%N4mDDDN		D
tDzz!!!



4s
A
AAc|dkr&	tj}n#t$rYdSwxYw	tj|}n4#t
$r'||}|tj|<YnwxYw|S)zGet the finder for the path entry from sys.path_importer_cache.

        If the path entry is not in the cache, find the appropriate finder
        and cache it. If no finder is available, store None.

        rN)rrgFileNotFoundErrorrrKeyErrorr)r2rLrs   r_path_importer_cachezPathFinder._path_importer_caches2::
z||$


tt
	3,T2FF	3	3	3__T**F,2C#D)))	3
s
**A.A21A2ct|drPt|d}tj|t
||\}}nNt|d}tj|t
||}g}|t||St	|d}||_
|S)Nrz5.find_spec() not found; falling back to find_loader()z5.find_spec() not found; falling back to find_module())rr_object_namerrrrr>r8rr)r2rrrrrrs       r_legacy_get_speczPathFinder._legacy_get_specs6=))
	 --f55444CN3
...%11(;;FHH --f55444CN3
...''11FH..x@@@$$Xt44*2'r
Ncg}|D]}t|ts||}|xt|dr|||}n|||}|o|j|cS|j}|td|	|t|d}||_|S)z?Find the loader or namespace_path for this module/package name.Nr:zspec missing loader)rrrrr:r	rrrrrr)	r2rrLr9namespace_pathentryrrrs	         r	_get_speczPathFinder._get_specs
		EeS))
--e44F!6;//B!++Hf==DD//&AAD<;*KKK:#%&;<<<
%%h///((488D.<D+Kr
c|tj}||||}|dS|j/|j}|r$d|_t
|||j|_|SdS|S)zTry to find a spec for 'fullname' on sys.path or 'path'.

        The search is based on sys.path_hooks and sys.path_importer_cache.
        N)rrLr
rrrr)r2rrLr9rrs      rr:zPathFinder.find_specsw<8D}}XtV44<4
[
 !<N
#2@>[^[h2i2i/tKr
cxtjdt|||}|dS|jS)zfind the module on sys.path or 'path' based on sys.path_hooks and
        sys.path_importer_cache.

        This method is deprecated.  Use find_spec() instead.

        zePathFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() insteadNr<r=s    rr>zPathFinder.find_modulesH	T)	+	+	+}}Xt,,<4{r
c(ddlm}|j|i|S)a 
        Find distributions.

        Return an iterable of all Distribution instances capable of
        loading the metadata for packages matching ``context.name``
        (or all names if ``None`` indicated) along the paths in the list
        of directories ``context.path``.
        rr)rrfind_distributions)rrrs   rrzPathFinder.find_distributionss/	:999994!4dEfEEEr
rUr?)rrrrrBrrrCrr	r
r:r>rrr
rrrmsHH//\/"

\
[*[([>[.


[

F
F\
F
F
Fr
rcXeZdZdZdZdZeZdZdZ	ddZ
dZed	Z
d
ZdS)
FileFinderzFile-based finder.

    Interactions with the file system are cached for performance, being
    refreshed when the directory the finder is handling has been modified.

    cg}|D]&\}|fd|D'||_|r|dkrtj|_n=t|s't
tj||_n||_d|_t|_	t|_
dS)zInitialize with the path to search on and a variable number of
        2-tuples containing the loader and the file suffixes the loader
        recognizes.c3 K|]}|fV	dSrUr)r	rrs  rrz&FileFinder.__init__.<locals>.<genexpr> s(CCFF+CCCCCCr
rrN)r_loadersrrgrLrlrO_path_mtimeset_path_cache_relaxed_path_cache)rrLloader_detailsloadersr rs     @rrGzFileFinder.__init__s .	D	DFHNNCCCC(CCCCCCC
	ts{{
DIIT""	"3:<<66DIIDI55#&55   r
cd|_dS)zInvalidate the directory mtime.rN)rrs rrzFileFinder.invalidate_caches-sr
ctjdt||}|dgfS|j|jpgfS)zTry to find a loader for the specified module, or the namespace
        package portions. Returns (loader, list-of-portions).

        This method is deprecated.  Use find_spec() instead.

        zeFileFinder.find_loader() is deprecated and slated for removal in Python 3.12; use find_spec() insteadN)rrrr:rr)rrrs   rrzFileFinder.find_loader3sW	T)	+	+	+~~h''<8O{D;ArAAr
c@|||}t||||S)Nr)r")rrrrLsmslr9rs       rr
zFileFinder._get_specBs7h--&xfBFHHH	Hr
Ncd}|dd}	t|jptjj}n#t$rd}YnwxYw||jkr|||_tr|j
}|}n	|j}|}||vrqt|j|}|jD]E\}	}
d|	z}t||}t|r||
|||g|cSFt#|}|jD]\}	}
	t|j||	z}n#t$$rYdSwxYwt&d|d||	z|vr*t|r||
||d|cS|r@t&d	|t&|d}
|g|
_|
SdS)
zoTry to find a spec for the specified module.

        Returns the matching spec, or None if not found.
        Frr8rrGNz	trying {})	verbosityzpossible namespace for {})rr]rLrrgrr_r_fill_cacher!rrrrOrrer
rhrrrrr)rrr9is_namespacetail_modulercachecache_module	base_pathrr
init_filename	full_pathrs              rr:zFileFinder.find_specGs_
))#..q1	ty8CJLL99BEE			EEE	D$$$$D==	',E&,,..LL$E&L5  "49k::I(,

6
6$ *V 3
&y-@@		**b>>,)i[Z`aaaaab
 +955$(M		8		8 FL
&ty+2FGG		


ttt
''Y!'LLLf$--	**8>>,)*.88888	''(CYOOO((488D/8kD+Kts#,AAA9E
E! E!cd|j}	tj|ptj}n#tt
tf$rg}YnwxYwtj	dst||_nut}|D]]}|d\}}}|r)d
||}n|}||^||_tj	t rd|D|_dSdS)zDFill the cache of potential modules and packages for this directory.rrrpc6h|]}|Sr)r)r	fns  rrz)FileFinder._fill_cache.<locals>.<setcomp>s 'F'F'Fr

'F'F'Fr
N)rLrlistdirrgrPermissionErrorNotADirectoryErrorrr#r$rrrrrraddr%r)	rrLcontentslower_suffix_contentsrrrrnew_names	         rr#zFileFinder._fill_cachezsAy	{4#73:<<88HH!?4FG			HHH	|&&u--	5"8}}D%(EE! 
4
4$(NN3$7$7!c6$&~~dFLLNNCCHH#H%))(33334D<""#>??	G'F'FX'F'F'FD$$$	G	Gs'1A
A
cfd}|S)aA class method which returns a closure to use on sys.path_hook
        which will return an instance using the specified loaders and the path
        called on the closure.

        If the path called on the closure is not a directory, ImportError is
        raised.

        cVt|std||gRS)z-Path hook for importlib.machinery.FileFinder.zonly directories are supportedr\)rhr)rLr2rs rpath_hook_for_FileFinderz6FileFinder.path_hook.<locals>.path_hook_for_FileFinders@t$$
O!"BNNNN3t-n----r
r)r2rr7s`` r	path_hookzFileFinder.path_hooks*	.	.	.	.	.	.('r
c6d|jS)NzFileFinder({!r}))rrrLrs rrzFileFinder.__repr__s!((333r
rU)rrrrrGrrr>rr
r:r#rCr8rrr
rrrs)))&$K
B
B
BHHH
1111fGGG>(([("44444r
rc4|d}|d}|s1|r|j}n'||krt||}nt||}|st	|||}	||d<||d<||d<||d<dS#t
$rYdSwxYw)N
__loader____spec__)r__file__
__cached__)getrrrr"	Exception)nsrpathname	cpathnamerrs      r_fix_up_modulerDs
VVL
!
!F
66*D6	6[FF

"
")$99FF%dH55FF&tXfEEE
:!<!:$<



s3B		
BBcxttjf}ttf}t
tf}|||gS)z_Returns a list of file-based module loaders.

    Each item is a tuple (loader, suffixes).
    )rrextension_suffixesrrrr)
extensionssourcebytecodes   rrrs9
%d&=&?&??J

.F#%66H))r
c
|adSrU)r)_bootstrap_modules r_set_bootstrap_modulerLs"JJJr
ct|t}tjtj|gtjtdS)z)Install the path-based import components.N)
rLrrrrrr8	meta_pathrHr)rKsupported_loaderss  r_installrPs[+,,,355N:/1BCDEEEM$$$$$r
)rnrU)NNN)rr)T)Vrrrrxrrrr#r@ntrr&posixr?allrFrrDrI_pathseps_with_colonr&%_CASE_INSENSITIVE_PLATFORMS_BYTES_KEYr%r'r!r/r5r9rOrYr]rcrerhrlrtype__code__rr-rr,r2rtrrrrHrFrArDEBUG_BYTECODE_SUFFIXESOPTIMIZED_BYTECODE_SUFFIXESrrrrrrrrrrrrrrobjectrr"r$rErZr|rrrrr_NamespaceLoaderrrrDrrLrPrr
r<module>r\sK,








|w&MMMMSkOOeO
s
4
4O
4
4
4444441''''/**99999'-#(:% E"E!F   777
***
***"?****<???"""222...
...0RRRR000
,T-(
)
)
jq(++g5NN<::
'#6""",T,..H8II5D0D0D0D0D0D0N%@%@%@PGGG&						>(BLLL8


0
9
9
9
9	D	D	D
FHH	D47@DDDDDR@@@@@@@@F<<<<<<<<<MMMMM=MMM`/ / / / / / / / d*-*-*-*-*-z<*-*-*-Z:}222222*m222jA A A A A A A A N,+,+,+,+,+,+,+,+`#
aFaFaFaFaFaFaFaFH[4[4[4[4[4[4[4[4@



.***###
%%%%%r
Back to Directory File Manager