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/ansible/parsing/__pycache__/splitter.cpython-39.pyc
a

�)gV,�@s�ddlmZmZmZeZddlZddlZddlm	Z	ddl
mZddlm
Z
dZe�d�eded	ed
�ejejB�Zdd�Zddd�Zdd�Zdd�Zdd�Zdd�ZdS)�)�absolute_import�division�print_functionN)�AnsibleParserError)�to_text)�unquotez[a-fA-F0-9]z�
    ( \\U{0}           # 8-digit hex escapes
    | \\u{1}           # 4-digit hex escapes
    | \\x{2}           # 2-digit hex escapes
    | \\N\{{[^}}]+\}}  # Unicode characters by name
    | \\[\\'"abfnrtv]  # Single-character escapes
    )���cCsdd�}t�||�S)NcSst�|�d�d�S)Nrzunicode-escape)�codecs�decode�group)�match�r�</usr/lib/python3.9/site-packages/ansible/parsing/splitter.py�decode_match+sz%_decode_escapes.<locals>.decode_match)�_ESCAPE_SEQUENCE_RE�sub)�srrrr�_decode_escapes*srFc
Cs�t|dd�}i}|du�r�zt|�}WnrtyV}ztd|d��WYd}~nLd}~0ty�}z,dt|���vr�td|d��n�WYd}~n
d}~00g}|D]�}t|�}d|v�rfd	}	z0|�d|	d
�}	|	d	kr�||	d
dkr�q�q�Wn*t�y|�	|�
dd��Yq�Yn0|d|	�}
||	d
d�}|�rP|
d
v�rP|�	|�nt|���||
��<q�|�	|�q�t
|�d	k�r�t|�|d<|S)a
    Convert a string of key/value items to a dict. If any free-form params
    are found and the check_raw option is set to True, they will be added
    to a new parameter called '_raw_params'. If check_raw is not enabled,
    they will simply be ignored.
    Zpassthru)Z	nonstringNzUnable to parse argument string)Zorig_exczno closing quotationz;error parsing argument string, try quoting the entire line.�=r��\z\=)ZcreatesZremoves�chdir�
executable�warn�stdinZstdin_add_newlineZstrip_empty_endsZ_raw_params)r�
split_args�
IndexErrorr�
ValueError�str�lowerr�index�append�replacer�strip�len�	join_args)�argsZ	check_raw�optionsZvargs�e�veZ
raw_paramsZorig_x�x�pos�k�vrrr�parse_kv1s@
 

r0cCsTd}t|�D]B\}}|dkr(||d}|dvr|dkr|rJ||krNd}q|}q|S)z�
    the goal of this block is to determine if the quoted string
    is unterminated in which case it needs to be put back together
    Nrrz"'r)�	enumerate)�token�
quote_charZ	prev_char�idxZcur_charrrr�_get_quote_statejsr5cCs8|�|�}|�|�}||kr4|||7}|dkr4d}|S)z�
    this function counts the number of opening/closing blocks for a
    given opening/closing type and adjusts the current depth for that
    block based on the difference
    r)�count)r2Z	cur_depthZ
open_tokenZclose_tokenZnum_openZ	num_closerrr�_count_jinja2_blocks~s

r7cCs>d}|D]0}t|�dks"|�d�r,||7}q|d|7}q|S)z
    Join the original cmd based on manipulations by split_args().
    This retains the original newlines and whitespaces.
    �r�
� )r&�endswith)r�result�prrrr'�s
r'cCstg}|�d�}d}d}d}d}d}t|�D�]\}}	|	�d�}
d}t|
�D�]�\}}
t|
�dkrz|dkrz|dd7<qJ|
dkr�|s�d}qJ|}t|
|�}|du}d}|r�|s�|s�|s�|s�|�|
�d}n�|s�|s�|s�|s�|�rV|dk�r|�rd	|d|
f|d<nLt|
�d
k�r>d}|dk�r&d}d|d||
f|d<nd
|d|
f|d<d}|}t|
|dd�}||k�r�|�s�|�|
�d}|}t|
|dd�}||k�r�|�s�|�|
�d}|}t|
|dd�}||k�r�|�s�|�|
�d}|sJ|sJ|sJ|sJ|sJ|
dkrJ|�|
�qJt|�d
k�rD|t|�d
k�rD|�sD|dd7<d}q*|�sb|�sb|�sb|�rptd�|���|S)a
    Splits args on whitespace, but intelligently reassembles
    those that may have been split over a jinja2 block or quotes.

    When used in a remote module, we won't ever have to be concerned about
    jinja2 blocks, however this function is/will be used in the
    core portions as well before the args are templated.

    example input: a=b c="foo bar"
    example output: ['a=b', 'c="foo bar"']

    Basically this is a variation shlex that has some more intelligence for
    how Ansible needs to use it.
    r9NFrr:���rTz%s%srr8z%s%s%sz%s
%sz{{z}}z{%z%}z{#z#}zOfailed at splitting arguments, either an unbalanced jinja2 block or quotes: {0})�splitr1r&r5r#r7r�format)r(�params�itemsr3Z
inside_quotesZprint_depthZblock_depthZ
comment_depthZitemidx�item�tokensZline_continuationr4r2Zwas_inside_quotesZappendedZspacerZprev_print_depthZprev_block_depthZprev_comment_depthrrrr�sr








&r)F)Z
__future__rrr�typeZ
__metaclass__r�reZansible.errorsrZansible.module_utils._textrZansible.parsing.quotingrZ_HEXCHAR�compiler@�UNICODE�VERBOSErrr0r5r7r'rrrrr�<module>s$�
�	
9