f4dZddlmZddlmZ ddlZ ddlZddl m Z ddl Z ddl Z ddl m Zgd Zd Zd ZGd d e j$Zeeej(ej*ej,ej.Gdde j$Zeeej2Gdde ZGdde Zeeej(ej*ej8GddeZeeej<Gddej>eeZeeej@ejBGddejDeeZ"ee"ej@y#e$rZejdk7rdZYdZ[pdZ[wwxYw#e$reZY}wxYw)z(Abstract base classes related to import.)_bootstrap_external) machineryN_frozen_importlib)Loader)abc)rMetaPathFinderPathEntryFinderResourceLoader InspectLoaderExecutionLoader FileLoader SourceLoaderc|tjvr?tt|}tjt d|d|t |<|Stdt d|)z{ For backwards compatibility, continue to make names from _resources_abc available through this module. #93963 .))removezmodule z has no attribute )_resources_abc__all__getattrwarnings _deprecated__name__globalsAttributeError)nameobjs $/usr/lib/python3.12/importlib/abc.py __getattr__r sb  ~%%%nd+z4&1'B $ 78,.@I JJc|D]F}|j|t tt|j}|j|Hy#t$rtt |j}Y9wxYw)N)registerrrrr_frozen_importlib_external) abstract_clsclassescls frozen_clss r _registerr))sp.c"  ( O$%6 E   ! !* -. " O$%?N  OsA  #A32A3ceZdZdZdZy)r z8Abstract base class for import finders on sys.meta_path.cy)zAn optional method for clearing the finder's cache, if any. This method is used by importlib.invalidate_caches(). Nselfs rinvalidate_cachesz MetaPathFinder.invalidate_caches;r!Nr __module__ __qualname____doc__r/r,r!rr r 4s B  r!r ) metaclassceZdZdZdZy)r z>Abstract base class for path entry finders used by PathFinder.cy)zAn optional method for clearing the finder's cache, if any. This method is used by PathFinder.invalidate_caches(). Nr,r-s rr/z!PathEntryFinder.invalidate_cachesHr0r!Nr1r,r!rr r Ds H r!r c4eZdZdZej dZy)r zAbstract base class for loaders which can return data from their back-end storage. This ABC represents one of the optional protocols specified by PEP 302. ct)zwAbstract method which when implemented should return the bytes for the specified path. The path must be a str.)OSErrorr.paths rget_datazResourceLoader.get_dataYs  r!N)rr2r3r4rabstractmethodr=r,r!rr r Ps! r!r ceZdZdZdZdZejdZe ddZ e jjZ e jjZy)r zAbstract base class for loaders which support inspection about the modules they can load. This ABC represents one of the optional protocols specified by PEP 302. ct)zOptional method which when implemented should return whether the module is a package. The fullname is a str. Returns a bool. Raises ImportError if the module cannot be found.  ImportErrorr.fullnames r is_packagezInspectLoader.is_packageis r!cL|j|}|y|j|S)aMethod which returns the code object for the module. The fullname is a str. Returns a types.CodeType if possible, else returns None if a code object does not make sense (e.g. built-in module). Raises ImportError if the module cannot be found. N) get_sourcesource_to_code)r.rDsources rget_codezInspectLoader.get_codeqs+* >""6**r!ct)zAbstract method which should return the source code for the module. The fullname is a str. Returns a str. Raises ImportError if the module cannot be found. rArCs rrGzInspectLoader.get_source~ r!c t||ddS)zCompile 'data' into a code object. The 'data' argument can be anything that compile() can handle. The'path' argument should be where the data was retrieved (when applicable).execT) dont_inherit)compile)datar<s rrHzInspectLoader.source_to_codes tT6==r!N)z)rr2r3r4rErJrr>rG staticmethodrHr _LoaderBasics exec_module load_moduler,r!rr r `sc + >>&33??K%33??Kr!r c:eZdZdZej dZdZy)r zAbstract base class for loaders that wish to support the execution of modules as scripts. This ABC represents one of the optional protocols specified in PEP 302. ct)zAbstract method which should return the value that __file__ is to be set to. Raises ImportError if the module cannot be found. rArCs r get_filenamezExecutionLoader.get_filenamerLr!c|j|}|y |j|}|j||S#t$r|j|cYSwxYw)zMethod to return the code object for fullname. Should return None if not applicable (e.g. built-in module). Raise ImportError if the module cannot be found. N)rGrXrHrB)r.rDrIr<s rrJzExecutionLoader.get_codesf * > 5$$X.D&&vt4 4 /&&v. . /s9AAN)rr2r3r4rr>rXrJr,r!rr r s& 5r!r ceZdZdZy)rz[Abstract base class partially implementing the ResourceLoader and ExecutionLoader ABCs.N)rr2r3r4r,r!rrrsr!rc"eZdZdZdZdZdZy)raAbstract base class for loading source code (and optionally any corresponding bytecode). To support loading from source code, the abstractmethods inherited from ResourceLoader and ExecutionLoader need to be implemented. To also support loading from bytecode, the optional methods specified directly by this ABC is required. Inherited abstractmethods not implemented in this ABC: * ResourceLoader.get_data * ExecutionLoader.get_filename c|jjtjurtt |j|dS)z6Return the (int) modification time for the path (str).mtime) path_stats__func__rr:intr;s r path_mtimezSourceLoader.path_mtimes8 ?? # #|'>'> >M4??4(122r!c|jjtjurtd|j|iS)a Return a metadata dict for the source pointed to by the path (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. r])rar_rr:r;s rr^zSourceLoader.path_statss5 ?? # #|'>'> >M.//r!cy)aWrite the bytes to the path (if possible). Accepts a str path and data as bytes. Any needed intermediary directories are to be created. If for some reason the file cannot be written because of permissions, fail silently. Nr,)r.r<rQs rset_datazSourceLoader.set_datar0r!N)rr2r3r4rar^rdr,r!rrrs 3 0 r!r)#r4rrrrBexcrr$_abcrrr resourcesrrr r)ABCMetar BuiltinImporterFrozenImporter PathFinderWindowsRegistryFinderr FileFinderr r NamespaceLoaderr ExtensionFileLoaderrSourceFileLoaderSourcelessFileLoaderrr,r!rrss.! 5% ,  K.  s{{   .)33Y5M5M    ? ?A    /9//0 V  0@F0@d -22I4L4LiNgNgh 5m 5D /9889$//  *i00  * *,* &33^_* X , 223S xx&&  5!45s(E'F 'F ,FF  FF