HEX
Server: LiteSpeed
System: Linux atali.colombiahosting.com.co 5.14.0-570.12.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 13 06:11:55 EDT 2025 x86_64
User: coopserp (1713)
PHP: 8.2.29
Disabled: dl,exec,passthru,proc_open,proc_close,shell_exec,memory_limit,system,popen,curl_multi_exec,show_source,symlink,link,leak,listen,diskfreespace,tmpfile,ignore_user_abord,highlight_file,source,show_source,fpaththru,virtual,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,posix_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setid,posix_times,posix_ttyname,posix_uname,proc_get_status,proc_nice,proc_terminate
Upload Files
File: //usr/lib/python3.9/site-packages/tuned/profiles/functions/__pycache__/parser.cpython-39.opt-1.pyc
a

,�ga�@s>ddlZddlZddlmZej��Ze�ZGdd�d�Z	dS)�N)�commandsc@sZeZdZdZdd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�Parserz;
	Parser used for expanding strings containing functions.
	cCs
||_dS�N)�_repository)�selfZ
repository�r�C/usr/lib/python3.9/site-packages/tuned/profiles/functions/parser.py�__init__szParser.__init__�cCs&d|_||_t|�|_g|_d|_dS)NrF)�_cnt�_str�len�_len�_stack�_esc�r�srrr�_parse_inits

zParser._parse_initcCs|j|jkr|j|jSdS)Nr
)rrr)rrrr�
_curr_charszParser._curr_charcCs|j|j|j|�Sr)rr)rrrrr�_curr_substrszParser._curr_substrcCs|j�||jf�dSr)r�appendr)rZescrrr�	_push_posszParser._push_poscCsd|jd|�||j|dd�|_t|j�|_|jt|�||d7_|jdkr`d|_dS)N�r)rr
rr)r�a�brrrr�_sub!s
&
zParser._subcCs�t�d|j||j��}|ddkr(dSdd�|D�}t�d|d�s\t�d|d�dSz|j�|d�}Wn&t	y�t�d	|d�YdS0|�
|d
d��}t�dd�|dd��|f�|dur�dS|�
||j|�dS)
Nz(?<!\\):rz${fcSsg|]}t|��dd��qS)z\:�:)�str�replace)�.0�vrrr�
<listcomp>,�z(Parser._process_func.<locals>.<listcomp>z\w+$rzinvalid function name '%s'zfunction '%s' not implemented�z${f:%s} expands to: '%s'r)�re�splitrr�match�log�errorrZ	load_func�ImportErrorZexecute�debug�joinr)rZ_from�sl�frrrr�
_process_func(s" zParser._process_funccCs�|�|�|j|jkr�|��dkrpz|j��}Wn&tyVt�d|�|j	YS0|ds�|�
|d�n|�d�dkr�|�|j
�|��dkr�d|_
nd	|_
|jd7_q
t|j�r�t�d
|�|j	S)N�}z.invalid variable syntax, non pair '}' in: '%s'rrr#z${�\TFz.invalid variable syntax, non pair '{' in: '%s')rrrrr�pop�
IndexErrorr'r(rr.rrrr
)rr�sirrr�_process;s&

zParser._processcCs(|dus|dkr|St�dd|�|��S)Nr
z\\(\${f:.*})z\1)r$�subr4rrrr�expandRsz
Parser.expandN)r
)
�__name__�
__module__�__qualname__�__doc__r	rrrrrr.r4r6rrrrr	s
r)
r$Z
tuned.logsZtunedZtuned.utils.commandsrZlogs�getr'�cmdrrrrr�<module>s