B
    QY                 @   sN   yd dl mZ W n( ek
r8   d dlmZ dd ZY nX dd Zdd Zd	S )
    )get_group_named)iter_entry_pointsc             C   s   dd t | D S )z9Facade function to align old entry_points api to new one.c             S   s   i | ]}||j qS  )name).0pluginr   r   @lib/python3.7/site-packages/anaconda_project/internal/plugins.py
<dictcomp>   s    z#get_group_named.<locals>.<dictcomp>)r   )Z
group_namer   r   r   r      s    r   c             C   s   dd t t|  D S )z/Return all the entry points plugins registered.c             S   s   i | ]\}}|  |qS r   )load)r   r   r   r   r   r   r	      s    z-_get_entry_points_plugins.<locals>.<dictcomp>)sortedr   items)entry_point_groupr   r   r   _get_entry_points_plugins   s    r   c             C   s   d|  }t |d}|S )a?  Return all the entry points plugins registered that implement that hook.

    The function will return all the plugins that implement the specified
    type of hook.

    Args:

        - plugin_hook_type(str): type of hook

    Output:
        (dict) with plugin name as key and plugin generator function as value
    zanaconda_project.plugins.%s)r   )r   )Zplugin_hook_typeZcommand_typeZentry_point_pluginsr   r   r   get_plugins   s    
r   N)Zentrypointsr   ImportErrorZpkg_resourcesr   r   r   r   r   r   r   <module>	   s   