3 À<×eã@sTddlmZddlmZddlZddljZddlm Z ej j ƒZ Gdd„deƒZ dS)é)Ú PluginLoaderé)ÚbaseN)ÚcommandscsHeZdZ‡fdd„Zedd„ƒZdd„Zdd„Zd d „Zd d „Z ‡Z S) Ú Repositorycstt|ƒjƒi|_dS)N)ÚsuperrÚ__init__Ú _functions)Úself)Ú __class__©ú /usr/lib/python3.6/repository.pyr szRepository.__init__cCs|jS)N)r )r r r r Ú functionsszRepository.functionscCs d|_tj|_tjjjj|_ dS)Nztuned.profiles.functions) Z _namespaceÚconstsZFUNCTION_PREFIXÚ_prefixÚtunedZprofilesrrZFunctionÚ _interface)r r r r Ú_set_loader_parameterssz!Repository._set_loader_parameterscCs,tjd|ƒ|j|ƒ}|ƒ}||j|<|S)Nzcreating function %s)ÚlogÚdebugZ load_pluginr )r Ú function_nameZ function_clsZfunction_instancer r r Úcreates   zRepository.createcCs||jkr|j|ƒS|j|S)N)r r)r rr r r Ú load_func!s  zRepository.load_funccCsNt||jƒst‚tjd|ƒx*t|jjƒƒD]\}}||kr.|j|=q.WdS)Nzremoving function %s)Ú isinstancerÚAssertionErrorrrÚlistr Úitems)r ZfunctionÚkÚvr r r Údelete&s zRepository.delete) Ú__name__Ú __module__Ú __qualname__rÚpropertyrrrrrÚ __classcell__r r )r r r s    r)Ztuned.utils.plugin_loaderrÚrZ tuned.logsrZ tuned.constsrZtuned.utils.commandsrZlogsÚgetrrr r r r Ús