ó
žS]c           @   sW   y d  d l  m Z Wn* e k
 r@ d  d l m Z d   Z n Xd   Z d   Z d S(   iĸĸĸĸ(   t   get_group_named(   t   iter_entry_pointsc         C   s   d   t  |   D S(   s9   Facade function to align old entry_points api to new one.c         S   s   i  |  ] } | | j   q S(    (   t   name(   t   .0t   plugin(    (    s@   lib/python2.7/site-packages/anaconda_project/internal/plugins.pys
   <dictcomp>   s   	 (   R   (   t
   group_name(    (    s@   lib/python2.7/site-packages/anaconda_project/internal/plugins.pyR       s    c         C   s    d   t  t |   j    D S(   s/   Return all the entry points plugins registered.c         S   s%   i  |  ] \ } } | j    |  q S(    (   t   load(   R   R   R   (    (    s@   lib/python2.7/site-packages/anaconda_project/internal/plugins.pys
   <dictcomp>   s   	 (   t   sortedR    t   items(   t   entry_point_group(    (    s@   lib/python2.7/site-packages/anaconda_project/internal/plugins.pyt   _get_entry_points_plugins   s    c         C   s   d |  } t  d |  } | S(   s?  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
    s   anaconda_project.plugins.%sR	   (   R
   (   t   plugin_hook_typet   command_typet   entry_point_plugins(    (    s@   lib/python2.7/site-packages/anaconda_project/internal/plugins.pyt   get_plugins   s    
N(   t   entrypointsR    t   ImportErrort   pkg_resourcesR   R
   R   (    (    (    s@   lib/python2.7/site-packages/anaconda_project/internal/plugins.pyt   <module>	   s   	