3
À<×eú ã @ s@ d dl mZ d dlZd dlZejjƒ ZdgZG dd„ deƒZ dS )é )ÚPluginLoaderNÚ
Repositoryc s@ e Zd Z‡ fdd„Zedd„ ƒZdd„ Zdd„ Zd d
„ Z‡ Z S )r c sJ t t| ƒjƒ tƒ | _|| _|| _|| _|| _|| _ || _
|| _|| _d S )N)
Úsuperr Ú__init__ÚsetÚ_pluginsÚ_monitor_repositoryÚ_storage_factoryÚ_hardware_inventoryÚ_device_matcherÚ_device_matcher_udevÚ_plugin_instance_factoryÚ_global_cfgÚ
_variables) ÚselfZmonitor_repositoryZstorage_factoryZhardware_inventoryZdevice_matcherZdevice_matcher_udevZplugin_instance_factoryZ
global_cfgÚ variables)Ú __class__© ú /usr/lib/python3.6/repository.pyr s zRepository.__init__c C s | j S )N)r )r r r r Úplugins s zRepository.pluginsc C s d| _ d| _tjjj| _d S )Nz
tuned.pluginsZplugin_)Z
_namespaceÚ_prefixÚtunedr ÚbaseZPluginÚ
_interface)r r r r Ú_set_loader_parameters s z!Repository._set_loader_parametersc C sN t jd| ƒ | j|ƒ}|| j| j| j| j| j| j| j | j
ƒ}| jj|ƒ |S )Nzcreating plugin %s)
ÚlogÚdebugZload_pluginr r r
r r r
r r r Úadd)r Zplugin_nameZ
plugin_clsZplugin_instancer r r Úcreate s
zRepository.createc C s6 t || jƒst‚tjd| ƒ |jƒ | jj|ƒ d S )Nzremoving plugin %s)Ú
isinstancer ÚAssertionErrorr r Zcleanupr Úremove)r Zpluginr r r Údelete( s zRepository.delete)
Ú__name__Ú
__module__Ú__qualname__r Úpropertyr r r r" Ú
__classcell__r r )r r r s
)
Ztuned.utils.plugin_loaderr Ztuned.plugins.baser Z
tuned.logsZlogsÚgetr Ú__all__r r r r r Ú