Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/stevedore/__pycache__/driver.cpython-39.pyc
Ðазад
a n�h � @ s8 d dl mZ d dl mZ d dlmZ G dd� de�ZdS )� )�MultipleMatches)� NoMatches)�NamedExtensionManagerc sl e Zd ZdZddi dddf� fdd� Zedd � �Zed� fdd� �Z� fd d�Z dd� Z edd� �Z� Z S )� DriverManagera Load a single plugin with a given name from the namespace. :param namespace: The namespace for the entry points. :type namespace: str :param name: The name of the driver 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 warn_on_missing_entrypoint: bool F� NTc s, |p| j }t� j||g||||||d� d S )N)� namespace�names�invoke_on_load�invoke_args�invoke_kwds�on_load_failure_callback�verify_requirements�warn_on_missing_entrypoint)�_default_on_load_failure�super�__init__) �selfr �namer r r r r r �� __class__r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/stevedore/driver.pyr / s ��zDriverManager.__init__c C s � d S �Nr )Z drivermanager�ep�errr r r r A s z&DriverManager._default_on_load_failure�TESTINGc s t � j|g||||d�}|S )a� Construct a test DriverManager Test instances are passed a list of extensions to work from rather than loading them from entry points. :param extension: Pre-configured Extension instance :type extension: :class:`~stevedore.extension.Extension` :param namespace: The namespace for the manager; used only for identification since the extensions are passed in. :type namespace: str :param propagate_map_exceptions: Boolean controlling whether exceptions are propagated up through the map call or whether they are logged and then ignored :type propagate_map_exceptions: bool :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 :return: The manager instance, initialized for testing )r �propagate_map_exceptionsr r )r �make_test_instance)�cls� extensionr r r r �or r r r E s �z DriverManager.make_test_instancec sh t � �|� | js.| jd }td| j|f ��t| j�dkrdd�dd� | jD ��}td| j|f ��d S )N� z"No %r driver found, looking for %rr �,c s s | ]}|j V qd S r )Zentry_point_target)�.0�er r r � <genexpr>t s �z.DriverManager._init_plugins.<locals>.<genexpr>zMultiple %r drivers found: %s) r � _init_plugins� extensionsZ_namesr r �len�joinr )r r&