U
    [e                     @   s    d dl mZ G dd deZdS )   )NamedExtensionManagerc                       sF   e Zd ZdZddi ddddf fdd	Zd fdd	Zd	d
 Z  ZS )HookManagera  Coordinate execution of multiple extensions using a common name.

    :param namespace: The namespace for the entry points.
    :type namespace: str
    :param name: The name of the hooks to load.
    :type name: str
    :param invoke_on_load: Boolean controlling whether to invoke the
        object returned by the entry point after the driver is loaded.
    :type invoke_on_load: bool
    :param invoke_args: Positional arguments to pass when invoking
        the object returned by the entry point. Only used if invoke_on_load
        is True.
    :type invoke_args: tuple
    :param invoke_kwds: Named arguments to pass when invoking
        the object returned by the entry point. Only used if invoke_on_load
        is True.
    :type invoke_kwds: dict
    :param on_load_failure_callback: Callback function that will be called when
        an entrypoint can not be loaded. The arguments that will be provided
        when this is called (when an entrypoint fails to load) are
        (manager, entrypoint, exception)
    :type on_load_failure_callback: function
    :param verify_requirements: Use setuptools to enforce the
        dependencies of the plugin(s) being loaded. Defaults to False.
    :type verify_requirements: bool
    :type on_missing_entrypoints_callback: function
    :param warn_on_missing_entrypoint: Flag to control whether failing
        to load a plugin is reported via a log mess. Only applies if
        on_missing_entrypoints_callback is None.
    :type warn_on_missing_entrypoint: bool

    F Nc
           
         s(   t t| j||g|||||||	d	 d S )N)invoke_on_loadinvoke_argsinvoke_kwdson_load_failure_callbackon_missing_entrypoints_callbackverify_requirementswarn_on_missing_entrypoint)superr   __init__)
self	namespacenamer   r   r   r   r
   r	   r   	__class__r   P/var/www/html/services/stratfitenv/lib/python3.8/site-packages/stevedore/hook.pyr   2   s    	
zHookManager.__init__c                    s&   t t| j||||d |d | _d S )N)propagate_map_exceptionsr       )r   r   _init_attributes_name)r   r   namesZ
name_orderr   r   r   r   r   r   G   s    
 zHookManager._init_attributesc                 C   s   || j krt|| jS )zReturn the named extensions.

        Accessing a HookManager as a dictionary (``em['name']``)
        produces a list of the :class:`Extension` instance(s) with the
        specified name, in the order they would be invoked by map().
        )r   KeyError
extensions)r   r   r   r   r   __getitem__P   s    
zHookManager.__getitem__)FFN)__name__
__module____qualname____doc__r   r   r   __classcell__r   r   r   r   r      s   "     	r   N)namedr   r   r   r   r   r   <module>   s   