o
    Uh0                     @  sZ   d dl mZ d dlZd dlmZ d dlmZ dZG dd dZG dd	 d	eZ	d	dgZ
dS )
    )annotationsN)OrderedDict)entry_points 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      c                 s      | ]
}|j | fV  qd S Nnameload.0er   r   n/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/virtualenv/run/plugin/base.py	<genexpr>       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)selfr*   r.   r   r,   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)r1   r   choicesr   r   r   r/   *   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   r,   r*   RuntimeErrorr+   populate_selected_argparseapp_data)r1   r3   selectedmsgr   r   r   handle_selected_arg_parse-   s   
z*ComponentBuilder.handle_selected_arg_parsec                 C  s.   d| j  d| | j_| j| j| j| d S )Nzoptions for  )r   r.   descriptionr+   add_parser_argumentsr*   )r1   r:   r9   r   r   r   r8   6   s   z+ComponentBuilder.populate_selected_argparsec                 C  s   |  || jS r   )r+   r*   )r1   r3   r   r   r   create:   s   zComponentBuilder.createN)r'   r(   )
r    r!   r"   r2   r$   r3   r/   r<   r8   r@   r   r   r   r   r&      s    

	r&   )
__future__r   r   collectionsr   importlib.metadatar   r   r   r&   __all__r   r   r   r   <module>   s    $