%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3.9/site-packages/ansible/template/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3.9/site-packages/ansible/template/__pycache__/native_helpers.cpython-39.opt-1.pyc

a

�)g�@s�ddlmZmZmZeZddlZddlmZm	Z	ddl
mZddlm
Z
ddlmZddlmZddlmZd	d
dd�ZGdd
�d
ej�Zdd�Zdd�Zdd�ZdS)�)�absolute_import�division�print_functionN)�islice�chain)�
GeneratorType��to_text)�string_types)�AnsibleVaultEncryptedUnicode)�NativeJinjaTextTF)�trueZfalseZnullc@seZdZdd�ZdS)�Json2PythoncCs |jtvr|Stjt|jd�S)N)�value)�id�	_JSON_MAP�astZConstant)�selfZnode�r�C/usr/lib/python3.9/site-packages/ansible/template/native_helpers.py�
visit_Names
zJson2Python.visit_NameN)�__name__�
__module__�__qualname__rrrrrrsrc
Cs�tt|d��}|sdSt|�dkrB|d}t|t�r8|St|�}n(t|t�rVt||�}d�dd�|D��}|�	d�s||dvr�z&t
�t
�t
��t
j|d	d
����}Wntttfy�Yn0|S)anReturn a string of concatenated compiled nodes. Throw an undefined error
    if any of the nodes is undefined.

    If the result of concat appears to be a dictionary, list or bool,
    try and convert it to such using literal_eval, the same mechanism as used
    in jinja2_native.

    Used in Templar.template() when jinja2_native=False and convert_data=True.
    ���rcSsg|]}t|��qSrr��.0�vrrr�
<listcomp>:�z'ansible_eval_concat.<locals>.<listcomp>)�{�[)�True�False�eval��mode)�listr�len�
isinstancerr	rr�join�
startswithr�literal_evalZfix_missing_locationsrZvisit�parse�
ValueError�SyntaxError�MemoryError)�nodes�head�outrrr�ansible_eval_concat!s.




���r6cCsd�dd�|D��S)aReturn a string of concatenated compiled nodes. Throw an undefined error
    if any of the nodes is undefined. Other than that it is equivalent to
    Jinja2's default concat function.

    Used in Templar.template() when jinja2_native=False and convert_data=False.
    rcSsg|]}t|��qSrrrrrrr Sr!z"ansible_concat.<locals>.<listcomp>)r,)r3rrr�ansible_concatLsr7c
Cs�tt|d��}|sdSt|�dkrX|d}t|t�r:|jSt|t�rH|St|t�s�|Sn(t|t�rlt	||�}d�
dd�|D��}zt�tj
|dd	��}Wntttfy�|YS0t|t�r�|d}|�|�|��S|S)
a�Return a native Python type from the list of compiled nodes. If the
    result is a single node, its value is returned. Otherwise, the nodes are
    concatenated as strings. If the result can be parsed with
    :func:`ast.literal_eval`, the parsed value is returned. Otherwise, the
    string is returned.

    https://github.com/pallets/jinja/blob/master/src/jinja2/nativetypes.py
    rNrrrcSsg|]}t|��qSrrrrrrr {r!z)ansible_native_concat.<locals>.<listcomp>r&r')r)rr*r+r�datarr
rrr,rr.r/r0r1r2)r3r4r5Zevaled�quoterrr�ansible_native_concatVs0	




�

r:)Z
__future__rrr�typeZ
__metaclass__r�	itertoolsrr�typesrZansible.module_utils._textr	Zansible.module_utils.sixr
Zansible.parsing.yaml.objectsrZansible.utils.native_jinjarrZNodeTransformerrr6r7r:rrrr�<module>s �+

Zerion Mini Shell 1.0