Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/site-packages/mako/testing/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/site-packages/mako/testing/__pycache__/helpers.cpython-38.pyc
U

O��gW�@s�ddlZddlZddlmZddlZddlZddlmZddlmZdd�Z	dd�Z
d	d
�Zdeeefe
e
ed
�dd�Zddd�Zdd�Zdd�Zejddd��ZdS)�N)�Path)�Union)�mockcCst�dd|���S)Nz	[\s\r\n]+� )�re�sub�strip��result�r�A/opt/cppython/lib/python3.8/site-packages/mako/testing/helpers.py�flatten_result
sr
c	Cs dd�t�dt�dd|��D�S)NcSs g|]}|��dkr|���qS���r��.0�xrrr�
<listcomp>s�z result_lines.<locals>.<listcomp>�\r?\nz +r)r�splitrr	rrr�result_liness�rcCsdd�t�d|�D�S)NcSsg|]}|��dkr|�qSrrrrrrrsz$result_raw_lines.<locals>.<listcomp>r)rrr	rrr�result_raw_linessrTF)�filespec�
make_absolute�check_exists�returncCs6t|�}|r|j|d�}|r2|��s2td|����|S)N)�strictzNo file or directory at )r�resolve�exists�FileNotFoundError)rrr�pathrrr�	make_pathsr"c	Cs2t��}|rt�t�}|�|��W5QRXdS)N)�
contextlib�nullcontext�suppressr �unlink)r!�
missing_ok�cmrrr�_unlink_path's

r)cCs&t�|�}t|dd�|jdd�|S)NT)r')�exist_ok)�pathlibrr)�mkdir)Zpathspecr!rrr�replace_file_with_dir1s
r-c	Cs$t|d��}|�d�W5QRX|S)N�wz*
i am an artificial template just for you
)�open�write)r�frrr�file_with_template_code8s
�r2�c	cs8t��|d}t�d��}||j_dVW5QRXdS)Nizmako.codegen.time)�timer�patchZreturn_value)�hoursZrewoundZcodegen_timerrr�rewind_compile_timeBsr7)TF)F)r3)r#r+rrr4�typingrZunittestrr
rr�str�boolr"r)r-r2�contextmanagerr7rrrr�<module>s,�
�




F1le Man4ger