HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //lib/python3.9/site-packages/tuned/profiles/__pycache__/loader.cpython-39.pyc
a

,�g��@svddlZddlZddlmZmZddlmZddlZ	ddl
Z
ddlZddlZddl
mZej��ZGdd�de�ZdS)�N)�ConfigParser�Error)�InvalidProfileExceptionc@speZdZdZgd�Zdd�Zdd�Zedd��Ze	d	d
��Z
dd�Zd
d�Zdd�Z
dd�Zdd�Zdd�ZdS)�Loaderz
	Profiles loader.
	)�_profile_locator�_profile_merger�_profile_factory�_global_config�
_variablescCs"||_||_||_||_||_dS�N)rrrr	r
)�self�profile_locatorZprofile_factoryZprofile_mergerZ
global_config�	variables�r�9/usr/lib/python3.9/site-packages/tuned/profiles/loader.py�__init__s
zLoader.__init__cCstjj�||�Sr)�tuned�profiles�profileZProfile)r�profile_name�configrrr�_create_profileszLoader._create_profilecCst�d|�S)Nz^[a-zA-Z0-9_.-]+$)�re�match)�clsrrrr�	safe_nameszLoader.safe_namecCs|jSr)r)rrrrr
"szLoader.profile_locatorcCs�t|�tur|��}tt|j|��}t|�dkr8td��t|�dkrZt�dd�	|��nt�d|d�g}g}|�
|||�t|�dkr�|j�|�}n|d}d�	|�|_
d|jvr�|j�|jdj�|jd=|�|�|�|�|S)	Nrz.No profile or invalid profiles were specified.�zloading profiles: %sz, zloading profile: %s� r)�type�list�split�filterr�lenr�log�info�join�
_load_profiler�merge�name�unitsr
Zadd_from_cfg�options�_expand_vars_in_devices�_expand_vars_in_regexes)r�
profile_namesr�processed_filesZ
final_profilerrr�load&s*


zLoader.loadcCs,|jD] }|j�|j|j�|j|_qdSr)r)r
�expandZdevices�rrZunitrrrr+Ds
zLoader._expand_vars_in_devicescCsH|jD]<}|j�|j|j�|j|_|j�|j|j�|j|_qdSr)r)r
r0Z
cpuinfo_regexZuname_regexr1rrrr,Hs
zLoader._expand_vars_in_regexesc		Cs�|D]�}|j�||�}|dkr q|durDtd|tt|jj��f��|�|�|�|�}|j�	||�}d|j
vr�t�d|j
�|j
�d���}|�|||�|�|�qdS)N�z!Cannot find profile '%s' in '%s'.Zincludez
\s*[,;]\s*)rZ
get_configrr�reversedZ_load_directories�append�_load_config_datarZcreater*rr r
r0�popr&)	rr-rr.r(�filenamerrZ
include_namesrrrr&Ms


zLoader._load_profilecCst�d||�S)Nz(?<!\\)\$\{i:PROFILE_DIR\})r�sub)rZprofile_dir�stringrrr�_expand_profile_dir^szLoader._expand_profile_dirc

Cs:zLtdddd�}t|_t|��}|�||�Wd�n1s@0YWn4tjy�}ztd||��WYd}~n
d}~00t�	�}t
j�|�}t
|���D]�}t�	�||<|�|�D]8}|j||dd�|||<|�||||�|||<q�||�d�dur�t
j�|||d�}	t
j�|	�g||d<q�|S)	N�=�#F)Z
delimitersZinline_comment_prefixes�strictzCannot parse '%s'.T)�rawZscript)r�strZoptionxform�openZ	read_filer�	__bases__r�collections�OrderedDict�os�path�dirnamerZsectionsr*�getr:r%�normpath)
r�	file_nameZ
config_obj�f�erZdir_name�section�optionZscript_pathrrrr5as$
.$zLoader._load_config_dataN)�__name__�
__module__�__qualname__�__doc__�	__slots__rr�classmethodr�propertyr
r/r+r,r&r:r5rrrrr
s

r)Ztuned.profiles.profilerZtuned.profiles.variablesZtuned.utils.config_parserrrZtuned.constsZconstsZos.pathrDrBZ
tuned.logsrZtuned.profiles.exceptionsrZlogsrGr#�objectrrrrr�<module>s