o
    f                     @  s   d dl mZ d dlZd dlmZ ejdkrd dlmZ dZnd dl	mZm
Z
 edd	 e
d
ddd D ZG dd dZG dd deZddgZdS )    )annotationsN)OrderedDict)      )entry_points )r   versionc                 c  s    | ]}t |V  qd S N)int).0ir   r   P/var/www/html/dev/env/lib/python3.10/site-packages/virtualenv/run/plugin/base.py	<genexpr>   s    r   importlib_metadata.   c                   @  s,   e Zd ZdZdZedd Zedd ZdS )PluginLoaderNc                 C  sN   t jdks	tdkrtdd |  j|dD S tdd |  |i D S )N)r   
   )r      c                 s      | ]
}|j | fV  qd S r	   nameloadr   er   r   r   r          z0PluginLoader.entry_points_for.<locals>.<genexpr>)groupc                 s  r   r	   r   r   r   r   r   r      r   )sysversion_infoimportlib_metadata_versionr   r   selectgetclskeyr   r   r   entry_points_for   s   zPluginLoader.entry_points_forc                   C  s   t jd u r	t t _t jS r	   )r   _ENTRY_POINTSr   r   r   r   r   r      s   
zPluginLoader.entry_points)	__name__
__module____qualname___OPTIONSr&   classmethodr%   staticmethodr   r   r   r   r   r      s    
r   c                   @  sB   e Zd ZdddZedd Zdd Zd	d
 Zdd Zdd Z	dS )ComponentBuilderreturnNonec                 C  s<   || _ || _d | _|| _|j|d| _| |t| j d S )N)title)interpreterr   _impl_classpossibleadd_argument_groupparseradd_selector_arg_parselist)selfr1   r5   r   r3   r   r   r   __init__"   s   zComponentBuilder.__init__c                 C  s   | j d u r| || _ | j S r	   )r*   r%   r"   r   r   r   options*   s   
zComponentBuilder.optionsc                 C  s   t r	   )NotImplementedError)r8   r   choicesr   r   r   r6   0   s   z'ComponentBuilder.add_selector_arg_parsec                 C  sH   t || j}|| jvrd| j }t|| j| | _| ||j |S )NzNo implementation for )getattrr   r3   r1   RuntimeErrorr2   populate_selected_argparseapp_data)r8   r:   selectedmsgr   r   r   handle_selected_arg_parse3   s   
z*ComponentBuilder.handle_selected_arg_parsec                 C  s.   d| j  d| | j_| j| j| j| d S )Nzoptions for  )r   r5   descriptionr2   add_parser_argumentsr1   )r8   rA   r@   r   r   r   r?   <   s   z+ComponentBuilder.populate_selected_argparsec                 C  s   |  || jS r	   )r2   r1   )r8   r:   r   r   r   create@   s   zComponentBuilder.createN)r.   r/   )
r'   r(   r)   r9   r+   r:   r6   rC   r?   rG   r   r   r   r   r-   !   s    

	r-   )
__future__r   r   collectionsr   r   importlib.metadatar   r   r   r   tuplesplitr   r-   __all__r   r   r   r   <module>   s    
$$