← Back
Editing: global_config.cpython-312.opt-1.pyc
� �]�i� � � � d dl Z d dlZd dlmZmZ d dlmZ d dlm Z d dl mZ dgZej j � Z G d� d� Zy)� N)�ConfigParser�Error)�TunedException)�commands�GlobalConfigc � � e Zd Zej fd�Zed� � Zej fd�Zdd�Z dd�Z dd�Zg fd�Zd � Z dd �Zy) r c �T � i | _ | j |�� t � | _ y )N)� file_name)�_cfg�load_configr �_cmd)�self�config_files �>/usr/lib/python3.12/site-packages/tuned/utils/global_config.py�__init__zGlobalConfig.__init__ s# � ��$�)����[��)��j�$�)� c � � t t � D � cg c]7 } | j d� r$| j d� s| j d� s| ��9 }} t d� |D � � }t d� |D � � }||fS c c} w )ai Easy validation mimicking configobj Returns two dicts, first with default values (default None) global_default[consts.CFG_SOMETHING] = consts.CFG_DEF_SOMETHING or None second with configobj function for value type (default "get" for string, others eg getboolean, getint) global_function[consts.CFG_SOMETHING] = consts.CFG_FUNC_SOMETHING or get } �CFG_� CFG_FUNC_�CFG_DEF_c 3 �j K � | ]+ }t t |� t t d |dd z d� f�� �- y�w)r � N��getattr�consts��.0�opts r � <genexpr>z6GlobalConfig.get_global_config_spec.<locals>.<genexpr>! s7 � �� �o�gn�`c����-�w�v�z�C�PQ�PR�G�?S�UY�/Z�[�gn�� �13c 3 �j K � | ]+ }t t |� t t d |dd z d� f�� �- y�w)r r N�getr r s r r z6GlobalConfig.get_global_config_spec.<locals>.<genexpr>"