Your IP : 3.145.92.213


Current Path : /opt/alt/python310/lib64/python3.10/importlib/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/importlib/__pycache__/abc.cpython-310.opt-1.pyc

o

6��fU8�
@s�dZddlmZddlmZzddlZWney.Zzejdkr"�dZWYdZ[ndZ[wwzddlZWney@eZYnwddl	m
Z
ddlZddlZddl
mZmZmZdd	l
mZmZd
d�ZGdd
�d
ejd�ZGdd�dejd�Zeeejejejej�Gdd�dejd�Zeeej�Gdd�de
�ZGdd�de
�Zeeejej�Gdd�de�Zeeej �Gdd�dej!ee�Z!ee!ej"ej#�Gdd�dej$ee�Z$ee$ej"�Gdd�dejd�Z%eGdd �d e��Z&Gd!d"�d"e%�Z'dS)#z(Abstract base classes related to import.�)�_bootstrap_external)�	machinery�N�_frozen_importlib)�Loader)�BinaryIO�Iterable�Text)�Protocol�runtime_checkablec	GsZ|D](}|�|�tdur*ztt|j�}Wnty$tt|j�}Ynw|�|�qdS�N)�registerr�getattr�__name__�AttributeError�_frozen_importlib_external)Zabstract_clsZclasses�clsZ
frozen_cls�r�4/opt/alt/python310/lib64/python3.10/importlib/abc.py�	_registers
�
��rc@s(eZdZdZdd�Zejddd��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
    cCst�dt�dS)Nzqthe Finder ABC is deprecated and slated for removal in Python 3.12; use MetaPathFinder or PathEntryFinder instead��warnings�warn�DeprecationWarning��selfrrr�__init__,s�zFinder.__init__NcCst�dt�dS)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.
        z�importlib.abc.Finder along with its find_module() method are deprecated and slated for removal in Python 3.12; use MetaPathFinder.find_spec() or PathEntryFinder.find_spec() insteadNr)r�fullname�pathrrr�find_module2s�zFinder.find_moduler)r�
__module__�__qualname__�__doc__r�abc�abstractmethodr rrrrr s

r)�	metaclassc@s eZdZdZdd�Zdd�ZdS)�MetaPathFinderz8Abstract base class for import finders on sys.meta_path.cCs<tjdtdd�t|d�sdS|�||�}|dur|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.

        z�MetaPathFinder.find_module() is deprecated since Python 3.4 in favor of MetaPathFinder.find_spec() and is slated for removal in Python 3.12���
stacklevel�	find_specN)rrr�hasattrr+�loader)rrr�foundrrrr Gs�
zMetaPathFinder.find_modulecC�dS)z�An optional method for clearing the finder's cache, if any.
        This method is used by importlib.invalidate_caches().
        Nrrrrr�invalidate_caches\�z MetaPathFinder.invalidate_cachesN)rr!r"r#r r0rrrrr'@sr'c@s&eZdZdZdd�ZejZdd�ZdS)�PathEntryFinderz>Abstract base class for path entry finders used by PathFinder.cCsXtjdtdd�t|d�sdgfS|�|�}|dur(|js g}n|j}|j|fSdgfS)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)rrrr,r+�submodule_search_locationsr-)rrr.�portionsrrr�find_loaderls�


zPathEntryFinder.find_loadercCr/)z�An optional method for clearing the finder's cache, if any.
        This method is used by PathFinder.invalidate_caches().
        Nrrrrrr0�r1z!PathEntryFinder.invalidate_cachesN)	rr!r"r#r5r�_find_module_shimr r0rrrrr2es
 r2c@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.

    cC�t�)zwAbstract method which when implemented should return the bytes for
        the specified path.  The path must be a str.)�OSError�rrrrr�get_data�szResourceLoader.get_dataN)rr!r"r#r$r%r;rrrrr7�sr7c@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.

    cCr8)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.
        ��ImportError�rrrrr�
is_package��zInspectLoader.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_codecCr8)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.
        r=r?rrrrB��zInspectLoader.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)�datarrrrrC�szInspectLoader.source_to_codeN)rG)rr!r"r#r@rEr$r%rB�staticmethodrCr�
_LoaderBasics�exec_module�load_modulerrrrr<�s
r<c@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.

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

        Raises ImportError if the module cannot be found.
        r=r?rrr�get_filename�rFzExecutionLoader.get_filenamecCsN|�|�}|durdSz|�|�}Wnty |�|�YSw|�||�S)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)rBrQr>rC)rrrDrrrrrE�s
�zExecutionLoader.get_codeN)rr!r"r#r$r%rQrErrrrrP�s

rPc@seZdZdZdS)�
FileLoaderz[Abstract base class partially implementing the ResourceLoader and
    ExecutionLoader ABCs.N)rr!r"r#rrrrrRsrRc@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$|jjtjur	t�t|�|�d�S)z6Return the (int) modification time for the path (str).�mtime)�
path_stats�__func__rSr9�intr:rrr�
path_mtimeszSourceLoader.path_mtimecCs |jjtjur	t�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)rXrVrSr9r:rrrrU szSourceLoader.path_statscCr/)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)rrrKrrr�set_data+r1zSourceLoader.set_dataN)rr!r"r#rXrUrYrrrrrS	s
rSc@speZdZdZejdedefdd��Zejdedefdd��Z	ejdede
fd	d
��Zejdee
fdd��Zd
S)�ResourceReaderzDAbstract base class for loaders to provide resource reading support.�resource�returncCr8)z�Return an opened, file-like object for binary reading.

        The 'resource' argument is expected to represent only a file name.
        If the resource cannot be found, FileNotFoundError is raised.
        ��FileNotFoundError�rr[rrr�
open_resource;s
zResourceReader.open_resourcecCr8)z�Return the file system path to the specified resource.

        The 'resource' argument is expected to represent only a file name.
        If the resource does not exist on the file system, raise
        FileNotFoundError.
        r]r_rrr�
resource_pathGszResourceReader.resource_pathrcCr8)zjReturn True if the named 'path' is a resource.

        Files are resources, directories are not.
        r]r:rrr�is_resourceTrAzResourceReader.is_resourcecCr8)z+Return an iterable of entries in `package`.r]rrrr�contents\szResourceReader.contentsN)rr!r"r#r$r%r	rr`ra�boolrbr�strrcrrrrrZ8srZc@s�eZdZdZejdd��Zdd�Zddd�Zejd	e	fd
d��Z
ejd	e	fdd
��Zejdd��Zdd�Z
ejddd��Zejd	efdd��ZdS)�Traversablezt
    An object with a subset of pathlib.Path methods suitable for
    traversing directories and opening files.
    cCr/)z3
        Yield Traversable objects in self
        Nrrrrr�iterdirir1zTraversable.iterdircCs6|�d��}|��Wd�S1swYdS)z0
        Read contents of self as bytes
        �rbN��open�read)r�strmrrr�
read_bytesos$�zTraversable.read_bytesNcCs8|j|d��}|��Wd�S1swYdS)z/
        Read contents of self as text
        )�encodingNri)rrnrlrrr�	read_textvs$�zTraversable.read_textr\cCr/)z.
        Return True if self is a dir
        Nrrrrr�is_dir}r1zTraversable.is_dircCr/)z/
        Return True if self is a file
        Nrrrrr�is_file�r1zTraversable.is_filecCr/)�2
        Return Traversable child in self
        Nr�r�childrrr�joinpath�r1zTraversable.joinpathcCs
|�|�S)rr)rursrrr�__truediv__�s
zTraversable.__truediv__�rcOr/)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�kwargsrrrrj�r1zTraversable.opencCr/)zM
        The base name of this object without any parent references.
        Nrrrrr�name�r1zTraversable.namer)rw)rr!r"r#r$r%rgrmrordrprqrurvrj�abstractpropertyrer{rrrrrfbs"


	rfc@s>eZdZdZejdd��Zdd�Zdd�Zdd	�Z	d
d�Z
dS)
�TraversableResourceszI
    The required interface for providing traversable
    resources.
    cCr/)z3Return a Traversable object for the loaded package.Nrrrrr�files�r1zTraversableResources.filescCs|���|��d�S)Nrh)r~rurjr_rrrr`�sz"TraversableResources.open_resourcecCst|��rr]r_rrrra�sz"TraversableResources.resource_pathcCs|���|���Sr)r~rurqr:rrrrb�sz TraversableResources.is_resourcecCsdd�|����D�S)Ncss�|]}|jVqdSr)r{)�.0�itemrrr�	<genexpr>�s�z0TraversableResources.contents.<locals>.<genexpr>)r~rgrrrrrc�szTraversableResources.contentsN)rr!r"r#r$r%r~r`rarbrcrrrrr}�s
r})(r#�rrrr>�excr{r�_abcrr$r�typingrrr	r
rr�ABCMetarr'�BuiltinImporter�FrozenImporter�
PathFinder�WindowsRegistryFinderr2�
FileFinderr7r<rP�ExtensionFileLoaderrR�SourceFileLoader�SourcelessFileLoaderrSrZrfr}rrrr�<module>sX
��� !�.2"�,*C

?>