a Á]›iÙ ã @ s€ d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlm Z d dl mZ d dlm Z ej ¡ ZdgZG dd„ deƒZdS )é N)ÚGlobalConfig)ÚcommandsÚManagerc sœ e Zd ZdZd‡ fdd„ Zedd„ ƒZedd„ ƒZed d „ ƒZdd„ Z d d„ Z dd„ Zdd„ Zdd„ Z dd„ Zdd„ Zdd„ Zdd„ Zejfdd„Z‡ ZS ) r z? Manager creates plugin instances and keeps a track of them. Nc sJ t t| ƒ ¡ || _|| _|| _|| _g | _g | _|p:t ƒ | _ tƒ | _d S ©N) Úsuperr Ú__init__Ú_plugins_repositoryÚ_monitors_repositoryÚ_def_instance_priorityÚ_hardware_inventoryÚ _instancesÚ_pluginsr Ú_configr Ú_cmd)ÚselfÚplugins_repositoryZmonitors_repositoryZdef_instance_priorityZhardware_inventoryZconfig©Ú __class__© ú7/usr/lib/python3.9/site-packages/tuned/units/manager.pyr s zManager.__init__c C s | j S r )r ©r r r r Úplugins! s zManager.pluginsc C s | j S r )r r r r r Ú instances% s zManager.instancesc C s | j S r )r r r r r r ) s zManager.plugins_repositoryc C sF |j d u rdS | j tj¡}|d u r0| j d¡}t |j |tj ¡d uS )NTz /proc/cpuinfo) Z cpuinfo_regexr ÚgetÚconstsZCFG_CPUINFO_STRINGr Z read_fileÚreÚsearchÚ MULTILINE)r ÚunitZcpuinfo_stringr r r Ú_unit_matches_cpuinfo- s ÿÿzManager._unit_matches_cpuinfoc C sH |j d u rdS | j tj¡}|d u r2d t ¡ ¡}t |j |tj ¡d uS )NTú )Zuname_regexr r r ZCFG_UNAME_STRINGÚjoinÚosÚunamer r r )r r Zuname_stringr r r Ú_unit_matches_uname6 s ÿÿzManager._unit_matches_unamec C s@ g }t | ¡ ƒD ]€\}}|js.t d| ¡ q| |¡sHt d| ¡ q| |¡sbt d| ¡ q|jd u rzt| j ƒ|_nt|jƒ|_| |¡ q|jdd„ d t ¡ }|D ]}d ||j<