3
W>p_                 @   sl   d dl mZmZ d dlZd dlmZ ejdkr<d dlmZ nd dl	mZ G dd de
ZG d	d
 d
eZdS )    )absolute_importunicode_literalsN)OrderedDict      )entry_pointsc               @   s,   e Zd ZdZdZedd Zedd ZdS )PluginLoaderNc             C   s   t dd | j j|i D S )Nc             s   s   | ]}|j |j fV  qd S )N)nameload).0e r   /home/aldo/Documentos/tesis/tesis/device auto/pruebas pulsar/pruebaclonado/envClonado/lib/python3.6/site-packages/virtualenv/run/plugin/base.py	<genexpr>   s    z0PluginLoader.entry_points_for.<locals>.<genexpr>)r   r   get)clskeyr   r   r   entry_points_for   s    zPluginLoader.entry_points_forc               C   s   t jd krt t _t jS )N)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               @   s@   e Zd Zdd Zedd Zdd Zdd Zd	d
 Zdd Z	dS )ComponentBuilderc             C   s<   || _ || _d | _|| _|j|d| _| j|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 kr| j|| _ | j S )N)r   r   )r   r   r   r   r   options$   s    
zComponentBuilder.optionsc             C   s   t d S )N)NotImplementedError)r$   r	   choicesr   r   r   r"   *   s    z'ComponentBuilder.add_selector_arg_parsec             C   sD   t || j}|| jkr&tdj| j| j| | _| j||j |S )NzNo implementation for {})	getattrr	   r   RuntimeErrorformatr   r   populate_selected_argparseapp_data)r$   r&   selectedr   r   r   handle_selected_arg_parse-   s    
z*ComponentBuilder.handle_selected_arg_parsec             C   s*   dj | j|| j_| jj| j| j| d S )Nzoptions for {} {})r+   r	   r!   descriptionr   Zadd_parser_argumentsr   )r$   r.   r-   r   r   r   r,   5   s    z+ComponentBuilder.populate_selected_argparsec             C   s   | j || jS )N)r   r   )r$   r&   r   r   r   create9   s    zComponentBuilder.createN)
r   r   r   r%   r   r&   r"   r/   r,   r1   r   r   r   r   r      s   r   )r   r   )
__future__r   r   syscollectionsr   version_infoZimportlib.metadatar   Zimportlib_metadataobjectr   r   r   r   r   r   <module>   s   
