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: //proc/self/root/usr/lib/python3.9/site-packages/redis/asyncio/__pycache__/parser.cpython-39.pyc
a

��b�
�@sRddlmZmZmZmZmZmZddlmZm	Z	er@ddl
mZGdd�d�ZdS)�)�
TYPE_CHECKING�Any�Dict�Optional�Tuple�Union)�
RedisError�
ResponseError)�ClusterNodec@speZdZdZdZdd�dd�Zdeddd�d	d
�Zeee	e
dfd�d
d�Zeee	e
dfd�dd�ZdS)�CommandsParsera%
    Parses Redis commands to get command keys.

    COMMAND output is used to determine key locations.
    Commands that do not have a predefined key location are flagged with 'movablekeys',
    and these commands' keys are determined by the command 'COMMAND GETKEYS'.

    NOTE: Due to a bug in redis<7.0, this does not work properly
    for EVAL or EVALSHA when the `numkeys` arg is 0.
     - issue: https://github.com/redis/redis/issues/9493
     - fix: https://github.com/redis/redis/pull/9733

    So, don't use this with EVAL or EVALSHA.
    )�commands�nodeN)�returncCs
i|_dS)N)r)�self�r�8/usr/lib/python3.9/site-packages/redis/asyncio/parser.py�__init__szCommandsParser.__init__r
)r
rc�s�|r
||_|j�d�IdH}|��D]`\}}d|dvrBd||<q$|ddkrd|ddkrdd||<q$|ddkr$|ddkr$d||<q$d	d
�|��D�|_dS)NZCOMMANDZmovablekeys�flags����
first_key_posr�last_key_pos�cSsi|]\}}|��|�qSr)�upper)�.0�cmd�commandrrr�
<dictcomp>*�z-CommandsParser.initialize.<locals>.<dictcomp>)r
�execute_command�itemsr)rr
rrrrrr�
initializes


zCommandsParser.initialize.)�argsrc�st|�dkrdSz|j|d}Wntty�|d��t|dd��}|d}||jvr�|��IdH||jvr�t|���d���|j|}Yn0|dkr�|dfS|dkr�dS|dkr�|j|�IdHS|d}|dkr�t|�|}||d|d|d�S)	N�rrz( command doesn't exist in Redis commandsrrrZ
step_count)	�lenr�KeyError�split�listr rr�_get_moveable_keys)rr!rZcmd_namerrrr�get_keys/s0

�
zCommandsParser.get_keysc
�srz|jjdg|�R�IdH}WnNtyl}z6|��}d|vsFd|vrTWYd}~dS|�WYd}~n
d}~00|S)NzCOMMAND GETKEYSzInvalid argumentsz The command has no key arguments)r
rr	�__str__)rr!�keys�e�messagerrrr'Rs��z!CommandsParser._get_moveable_keys)N)
�__name__�
__module__�__qualname__�__doc__�	__slots__rrr rr�strr(r'rrrrr	s#rN)
�typingrrrrrrZredis.exceptionsrr	Zredis.asyncio.clusterr
rrrrr�<module>s