AlkantarClanX12

Your IP : 3.12.154.133


Current Path : /proc/self/root/opt/alt/python39/lib64/python3.9/importlib/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python39/lib64/python3.9/importlib/__pycache__/abc.cpython-39.opt-1.pyc

a

R�fL:�
@s�dZddlmZddlmZddlmZzddlZWn4eyhZzejdkrP�dZWYdZ[n
dZ[00zddl	Z	Wney�eZ	Yn0ddl
Z
ddlZddlm
Z
mZd	d
�ZGdd�de
jd
�ZGdd�de�Zeeejejejej�Gdd�de�Zeeej�Gdd�de
jd
�ZGdd�de�ZGdd�de�Zeeejej�Gdd�de�Zeeej�Gdd�dejee�Zeeejej �Gdd�dej!ee�Z!ee!ej�Gdd�de
jd
�Z"ee"ej�eGd d!�d!e
��Z#Gd"d#�d#e"�Z$dS)$z(Abstract base classes related to import.�)�
_bootstrap)�_bootstrap_external)�	machinery�N�_frozen_importlib)�Protocol�runtime_checkablec	GsZ|D]P}|�|�tdurztt|j�}WntyHtt|j�}Yn0|�|�qdS�N)�registerr�getattr�__name__�AttributeError�_frozen_importlib_external)�abstract_cls�classes�cls�
frozen_cls�r�2/opt/alt/python39/lib64/python3.9/importlib/abc.py�	_registers
rc@s eZdZdZejddd��ZdS)�Findera<Legacy abstract base class for import finders.

    It may be subclassed for compatibility with legacy third party
    reimplementations of the import system.  Otherwise, finder
    implementations should derive from the more specific MetaPathFinder
    or PathEntryFinder ABCs.

    Deprecated since Python 3.3
    NcCsdS)z�An abstract method that should find a module.
        The fullname is a str and the optional path is a str or None.
        Returns a Loader object or None.
        Nr)�self�fullname�pathrrr�find_module+szFinder.find_module)N)r�
__module__�__qualname__�__doc__�abc�abstractmethodrrrrrrs
r)�	metaclassc@s eZdZdZdd�Zdd�ZdS)�MetaPathFinderz8Abstract base class for import finders on sys.meta_path.cCs<tjdtdd�t|d�sdS|�||�}|dur8|jSdS)a_Return a loader for the module.

        If no module is found, return None.  The fullname is a str and
        the path is a list of strings or None.

        This method is deprecated since Python 3.4 in favor of
        finder.find_spec(). If find_spec() exists then backwards-compatible
        functionality is provided for this method.

        zxMetaPathFinder.find_module() is deprecated since Python 3.4 in favor of MetaPathFinder.find_spec() (available since 3.4)���
stacklevel�	find_specN)�warnings�warn�DeprecationWarning�hasattrr%�loader)rrr�foundrrrr:s�
zMetaPathFinder.find_modulecCsdS)z�An optional method for clearing the finder's cache, if any.
        This method is used by importlib.invalidate_caches().
        Nr�rrrr�invalidate_cachesOsz MetaPathFinder.invalidate_cachesN)rrrrrr-rrrrr!3sr!c@s&eZdZdZdd�ZejZdd�ZdS)�PathEntryFinderz>Abstract base class for path entry finders used by PathFinder.cCs\tjdtdd�t|d�s"dgfS|�|�}|durP|js@g}n|j}|j|fSdgfSdS)a[Return (loader, namespace portion) for the path entry.

        The fullname is a str.  The namespace portion is a sequence of
        path entries contributing to part of a namespace package. The
        sequence may be empty.  If loader is not None, the portion will
        be ignored.

        The portion will be discarded if another path entry finder
        locates the module as a normal module or package.

        This method is deprecated since Python 3.4 in favor of
        finder.find_spec(). If find_spec() is provided than backwards-compatible
        functionality is provided.
        zzPathEntryFinder.find_loader() is deprecated since Python 3.4 in favor of PathEntryFinder.find_spec() (available since 3.4)r"r#r%N)r&r'r(r)r%�submodule_search_locationsr*)rrr+�portionsrrr�find_loader_s�


zPathEntryFinder.find_loadercCsdS)z�An optional method for clearing the finder's cache, if any.
        This method is used by PathFinder.invalidate_caches().
        Nrr,rrrr-�sz!PathEntryFinder.invalidate_cachesN)	rrrrr1r�_find_module_shimrr-rrrrr.Xs r.c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�Loaderz'Abstract base class for import loaders.cCsdS)z�Return a module to initialize and into which to load.

        This method should raise ImportError if anything prevents it
        from creating a new module.  It may return None to indicate
        that the spec should create the new module.
        Nr)r�specrrr�
create_module�szLoader.create_modulecCst|d�st�t�||�S)a�Return the loaded module.

        The module must be added to sys.modules and have import-related
        attributes set properly.  The fullname is a str.

        ImportError is raised on failure.

        This method is deprecated in favor of loader.exec_module(). If
        exec_module() exists then it is used to provide a backwards-compatible
        functionality for this method.

        �exec_module)r)�ImportErrorr�_load_module_shim�rrrrr�load_module�s
zLoader.load_modulecCst�dS)z�Return a module's repr.

        Used by the module type when the method does not raise
        NotImplementedError.

        This method is deprecated.

        N)�NotImplementedError)r�modulerrr�module_repr�s
zLoader.module_reprN)rrrrr5r:r=rrrrr3�s
r3c@seZdZdZejdd��ZdS)�ResourceLoaderz�Abstract 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.

    cCst�dS)zwAbstract method which when implemented should return the bytes for
        the specified path.  The path must be a str.N)�OSError�rrrrr�get_data�szResourceLoader.get_dataN)rrrrrrrArrrrr>�sr>c@sLeZdZdZdd�Zdd�Zejdd��Ze	dd	d
��Z
ejj
Z
ejjZdS)
�
InspectLoaderz�Abstract 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.

    cCst�dS)z�Optional 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.
        N�r7r9rrr�
is_package�szInspectLoader.is_packagecCs |�|�}|durdS|�|�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_source�source_to_code)rr�sourcerrr�get_code�s
zInspectLoader.get_codecCst�dS)z�Abstract 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.
        NrCr9rrrrE�szInspectLoader.get_source�<string>cCst||ddd�S)z�Compile '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)�datarrrrrF�szInspectLoader.source_to_codeN)rI)rrrrrDrHrrrE�staticmethodrFr�
_LoaderBasicsr6r:rrrrrB�s

rBc@s&eZdZdZejdd��Zdd�ZdS)�ExecutionLoaderz�Abstract 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.

    cCst�dS)z�Abstract method which should return the value that __file__ is to be
        set to.

        Raises ImportError if the module cannot be found.
        NrCr9rrr�get_filenameszExecutionLoader.get_filenamecCsR|�|�}|durdSz|�|�}Wnty@|�|�YS0|�||�SdS)z�Method 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)rErQr7rF)rrrGrrrrrHs
zExecutionLoader.get_codeN)rrrrrrrQrHrrrrrP�s
rPc@seZdZdZdS)�
FileLoaderz[Abstract base class partially implementing the ResourceLoader and
    ExecutionLoader ABCs.N)rrrrrrrrrR"srRc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�SourceLoadera�Abstract 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

    cCs$|jjtjurt�t|�|�d�S)z6Return the (int) modification time for the path (str).�mtime)�
path_stats�__func__rSr?�intr@rrr�
path_mtime<szSourceLoader.path_mtimecCs |jjtjurt�d|�|�iS)aReturn 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.
        rT)rXrVrSr?r@rrrrUBszSourceLoader.path_statscCsdS)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)rrrMrrr�set_dataMszSourceLoader.set_dataN)rrrrrXrUrYrrrrrS+srSc@sHeZdZdZejdd��Zejdd��Zejdd��Zejdd	��Z	d
S)�ResourceReaderz�Abstract base class to provide resource-reading support.

    Loaders that support resource reading are expected to implement
    the ``get_resource_reader(fullname)`` method and have it either return None
    or an object compatible with this ABC.
    cCst�dS)aReturn an opened, file-like object for binary reading.

        The 'resource' argument is expected to represent only a file name
        and thus not contain any subdirectory components.

        If the resource cannot be found, FileNotFoundError is raised.
        N��FileNotFoundError�r�resourcerrr�
open_resourcecs	zResourceReader.open_resourcecCst�dS)a!Return the file system path to the specified resource.

        The 'resource' argument is expected to represent only a file name
        and thus not contain any subdirectory components.

        If the resource does not exist on the file system, raise
        FileNotFoundError.
        Nr[r]rrr�
resource_pathns
zResourceReader.resource_pathcCst�dS)z7Return True if the named 'name' is consider a resource.Nr[)r�namerrr�is_resourcezszResourceReader.is_resourcecCsgS)z?Return an iterable of strings over the contents of the package.rr,rrr�contentsszResourceReader.contentsN)
rrrrrrr_r`rbrcrrrrrZZs



rZc@s�eZdZdZejdd��Zejdd��Zejddd��Zejd	d
��Z	ejdd��Z
ejd
d��Zejdd��Zejddd��Z
ejdd��ZdS)�Traversablezt
    An object with a subset of pathlib.Path methods suitable for
    traversing directories and opening files.
    cCsdS)z3
        Yield Traversable objects in self
        Nrr,rrr�iterdir�szTraversable.iterdircCsdS�z0
        Read contents of self as bytes
        Nrr,rrr�
read_bytes�szTraversable.read_bytesNcCsdSrfr)r�encodingrrr�	read_text�szTraversable.read_textcCsdS)z.
        Return True if self is a dir
        Nrr,rrr�is_dir�szTraversable.is_dircCsdS)z/
        Return True if self is a file
        Nrr,rrr�is_file�szTraversable.is_filecCsdS�z2
        Return Traversable child in self
        Nr�r�childrrr�joinpath�szTraversable.joinpathcCsdSrlrrmrrr�__truediv__�szTraversable.__truediv__�rcOsdS)z�
        mode may be 'r' or 'rb' to open as text or binary. Return a handle
        suitable for reading (same as pathlib.Path.open).

        When opening as text, accepts encoding parameters such as those
        accepted by io.TextIOWrapper.
        Nr)r�mode�args�kwargsrrr�open�szTraversable.opencCsdS)zM
        The base name of this object without any parent references.
        Nrr,rrrra�szTraversable.name)N)rq)rrrrrrrergrirjrkrorpru�abstractpropertyrarrrrrd�s&





	rdc@s:eZdZejdd��Zdd�Zdd�Zdd�Zd	d
�Z	dS)�TraversableResourcescCsdS)z3Return a Traversable object for the loaded package.Nrr,rrr�files�szTraversableResources.filescCs|���|��d�S)N�rb)rxrorur]rrrr_�sz"TraversableResources.open_resourcecCst|��dSr	r[r]rrrr`�sz"TraversableResources.resource_pathcCs|���|���Sr	)rxro�isfiler@rrrrb�sz TraversableResources.is_resourcecCsdd�|����D�S)Ncss|]}|jVqdSr	)ra)�.0�itemrrr�	<genexpr>��z0TraversableResources.contents.<locals>.<genexpr>)rxrer,rrrrc�szTraversableResources.contentsN)
rrrrrrxr_r`rbrcrrrrrw�s
rw)%r�rrrrr7�excrarrr&�typingrrr�ABCMetarr!�BuiltinImporter�FrozenImporter�
PathFinder�WindowsRegistryFinderr.�
FileFinderr3r>rBrP�ExtensionFileLoaderrR�SourceFileLoader�SourcelessFileLoaderrSrZrdrwrrrr�<module>sR

!�./2"�,+B