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: //usr/lib/python3.9/site-packages/tuned/profiles/__pycache__/variables.cpython-39.pyc
a

,�g	�@shddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZmZej
��ZGdd�d�ZdS)�N)�	functions)�commands)�ConfigParser�Errorc@sXeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)�	Variablesz8
	Storage and processing of variables used in profiles
	cCs"t�|_i|_i|_t��|_dS�N)r�_cmd�
_lookup_re�_lookup_envrZ
Repository�
_functions��self�r�</usr/lib/python3.9/site-packages/tuned/profiles/variables.py�__init__szVariables.__init__cCs|�|�dkr|S||S)Nr)�find)r
�s�prefixrrr�_add_env_prefixszVariables._add_env_prefixcCst�d|�S)Nz\w+$)�re�match)r
�variablerrr�
_check_varszVariables._check_varcCsj|durdSt|�}|�|�s0t�d|�dS|�|�}||jdt�|�d<||j|�	|t
j�<dS)Nz6variable definition '%s' contains unallowed charactersz
(?<!\\)\${�})�strr�log�error�expandr	r�escaper
r�constsZ
ENV_PREFIX)r
r�valuer�vrrr�add_variables

zVariables.add_variablec
Cs�tj�|�st�d|�dSz`tddddd�}t|_t|��.}|�	dt
jd|��|�Wd�n1sr0YWn"t
y�t�d	|�YdS0|��D],}|�|�D]}|�||j||dd
��q�q�dS)Nz#unable to find variables_file: '%s'�=�#TF)Z
delimitersZinline_comment_prefixesZallow_no_value�strict�[z]
z"error parsing variables_file: '%s')�raw)�os�path�existsrrrrZoptionxform�openZread_stringrZMAGIC_HEADER_NAME�readrZsections�optionsr"�get)r
�filenameZconfig�fr�orrr�
add_from_file+s
@zVariables.add_from_filecCsB|D]8}t|�dkr,|�tj�||��q|�|||�qdS)NZinclude)rr2r(r)�normpathr")r
Zcfg�itemrrr�add_from_cfg;szVariables.add_from_cfgcCst�dd|j�|j|��S)Nz\\(\${\w+})z\1)r�subrZmultiple_re_replacer	)r
r rrr�
expand_staticCszVariables.expand_staticcCs&|durdS|�t|��}|j�|�Sr)r7rrr)r
r rrrrrFszVariables.expandcCs|jSr)r
rrrr�get_envNszVariables.get_envN)
�__name__�
__module__�__qualname__�__doc__rrrr"r2r5r7rr8rrrrrs
r)r(rZ
tuned.logsZtunedZtuned.constsrZtuned.profilesrZtuned.utils.commandsrZtuned.utils.config_parserrrZlogsr.rrrrrr�<module>s