
    yIf*                        d Z ddlmZ ddlmZmZ ddlmZmZm	Z	m
Z
 ddlmZ erddlmZ ddlmZmZ ddlmZmZ  G d	 d
e          Zdd
gZdS )zSources.    )annotations)ABCabstractmethod)TYPE_CHECKINGAnyIteratorList)Section)Path)LoaderOverrideMap)	ConfigSetCoreConfigSetc                      e Zd ZdZdZd$dZd%dZed&d            Zed'd            Z	ed(d            Z
ed)d            Zed*d            Zed+d!            Zed,d"            Zd#S )-Sourcez_Source is able to return a configuration value (for either the core or per environment source). pathr   returnNonec                "    || _         i | _        d S N)r   _section_to_loaders)selfr   s     I/var/www/piapp/venv/lib/python3.11/site-packages/tox/config/source/api.py__init__zSource.__init__   s    	AC       sectionr
   baselist[str] | Noneoverride_mapr   confr   Iterator[Loader[Any]]c              #    K   |                      |          }|j        }|| j        v r| j        |         E d{V  dS g }|| j        |<   |                     ||          }||                    |           |V  ||                    dt          t                   d|           |                     |d         |          D ]E}|}	|                     ||          }||	}|		|||	_	        |V  |                    |           DdS dS )a9  
        Return a loader that loads settings from a given section name.

        :param section: the section to load
        :param base: base sections to fallback to
        :param override_map: a list of overrides to apply
        :param conf: the config set to use
        :returns: the loaders to use
        Nr   z(inherit missing keys from these sections)keysof_typedescdefault)
transform_sectionkeyr   
get_loaderappend
add_configr	   strget_base_sectionsparent)
r   r   r   r    r!   r)   loadersloaderbase_sectionchilds
             r   get_loaderszSource.get_loaders   sX       ((11k$***/44444444F%'(/ %%)__Wl%K%KNN6"""LLLOOS	?	     !% 6 6tF|W M M 	' 	'|DD>"F$);#)ELv&&&&! 	' 	'r   c                    t           r   NotImplementedError)r   r   s     r   r(   zSource.transform_sectionH       !!r   Loader[Any] | Nonec                    t           r   r6   )r   r   r    s      r   r*   zSource.get_loaderL   r8   r   	list[str]
in_sectionIterator[Section]c                    t           r   r6   )r   r   r<   s      r   r.   zSource.get_base_sectionsP   r8   r   c                    t           )z
        Return a loader that loads the core configuration values.

        :returns: the core loader from this source
        r6   r   s    r   sectionszSource.sectionsT   s
     "!r   	core_confr   Iterator[str]c                    t           )z
        :param core_conf: the core configuration set
        :returns: a list of environments defined within this source
        r6   )r   rB   s     r   envszSource.envs]   s
     "!r   itemr-   $tuple[Section, list[str], list[str]]c                    t           )z+:returns: the section for a tox environmentr6   )r   rF   s     r   get_tox_env_sectionzSource.get_tox_env_sectione   
     "!r   c                    t           )z:returns: the core sectionr6   r@   s    r   get_core_sectionzSource.get_core_sectionj   rJ   r   N)r   r   r   r   )
r   r
   r   r   r    r   r!   r   r   r"   )r   r
   r   r
   )r   r
   r    r   r   r9   )r   r;   r<   r
   r   r=   )r   r=   )rB   r   r   rC   )rF   r-   r   rG   )r   r
   )__name__
__module____qualname____doc__FILENAMEr   r4   r   r(   r*   r.   rA   rE   rI   rL    r   r   r   r      s,       iiHD D D D,' ,' ,' ,'\ " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " "r   r   r
   N)rP   
__future__r   abcr   r   typingr   r   r   r	   tox.config.loader.sectionr
   pathlibr   tox.config.loader.apir   r   tox.config.setsr   r   r   __all__rR   r   r   <module>r[      s     " " " " " " # # # # # # # # 5 5 5 5 5 5 5 5 5 5 5 5 - - - - - - 99999999988888888\" \" \" \" \"S \" \" \"@ r   