<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
À<×e  ã               @   sT   d dl mZ ddlmZ d dlZd dljZd dlm	Z	 ej
jƒ ZG dd„ deƒZdS )é    )ÚPluginLoaderé   )ÚbaseN)Úcommandsc                   sH   e Zd Z‡ fdd„Zedd„ ƒZdd„ Zdd„ Zd	d
„ Zdd„ Z	‡  Z
S )Ú
Repositoryc                s   t t| ƒjƒ  i | _d S )N)Úsuperr   Ú__init__Ú
_functions)Úself)Ú	__class__© ú /usr/lib/python3.6/repository.pyr      s    zRepository.__init__c             C   s   | j S )N)r	   )r
   r   r   r   Ú	functions   s    zRepository.functionsc             C   s    d| _ tj| _tjjjj| _	d S )Nztuned.profiles.functions)
Z
_namespaceÚconstsZFUNCTION_PREFIXÚ_prefixÚtunedZprofilesr   r   ZFunctionÚ
_interface)r
   r   r   r   Ú_set_loader_parameters   s    z!Repository._set_loader_parametersc             C   s,   t jd| ƒ | j|ƒ}|ƒ }|| j|< |S )Nzcreating function %s)ÚlogÚdebugZload_pluginr	   )r
   Úfunction_nameZfunction_clsZfunction_instancer   r   r   Úcreate   s
    

zRepository.createc             C   s   || j kr| j|ƒS | j | S )N)r	   r   )r
   r   r   r   r   Ú	load_func!   s    

zRepository.load_funcc             C   sN   t || jƒst‚tjd| ƒ x*t| jjƒ ƒD ]\}}||kr.| j|= q.W d S )Nzremoving function %s)Ú
isinstancer   ÚAssertionErrorr   r   Úlistr	   Úitems)r
   ZfunctionÚkÚvr   r   r   Údelete&   s
    zRepository.delete)Ú__name__Ú
__module__Ú__qualname__r   Úpropertyr   r   r   r   r   Ú__classcell__r   r   )r   r   r   	   s   	r   )Ztuned.utils.plugin_loaderr   Ú r   Z
tuned.logsr   Ztuned.constsr   Ztuned.utils.commandsr   ZlogsÚgetr   r   r   r   r   r   Ú<module>   s   

