Sh3ll
OdayForums


Server : LiteSpeed
System : Linux premium84.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
User : claqxcrl ( 523)
PHP Version : 8.1.32
Disable Function : NONE
Directory :  /opt/hc_python/lib64/python3.12/site-packages/alembic/util/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/hc_python/lib64/python3.12/site-packages/alembic/util/__pycache__/pyfiles.cpython-312.pyc
�

���g�
����ddlmZddlZddlmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZddl
mZddlmZddlmZd	d
lmZd	dlmZ										dd�Zdd
�Zdd�Zdd�Zdd�Zy)�)�annotationsN)�	ExitStack)�
ModuleType)�Any)�Optional)�
exceptions)�Template�)�compat)�CommandErrorc���t|��}	|jdi|��j|�}t|d�5}|j	|�ddd�y#1swYyxYw#tjdd��5}|j	tj�j�j|��|j}ddd�n#1swYnxYwtdz��xYw)N)�filename�wbz.txtF)�suffix�deletezDTemplate rendering failed; see %s for a template-oriented traceback.�)r	�render_unicode�encode�open�write�tempfile�NamedTemporaryFiler�text_error_template�namer)	�
template_file�dest�output_encoding�kw�template�output�f�ntf�fnames	         �C/opt/hc_python/lib/python3.12/site-packages/alembic/util/pyfiles.py�template_to_filer%s�����/�H��(��(�(�.�2�.�5�5�o�F���$��
��
�G�G�F�O��
�
��
�
�
(�
(��u�
E���I�I��.�.�0���!����(�
�
�H�H�E�
F�
E�
E���
+�-2�
3�
�	
�s/�!A"�A�A�"C+�;A
C�	C+�C	�C+c�~�tjj|�s�d|vr�|jd�}t	�}tj|j�tjj|d�}|ddD]}||z}�	|jtjj|��}|S)z�Interpret a filename as either a filesystem location or as a package
    resource.

    Names that are non absolute paths and contain a colon
    are interpreted as resources and coerced to a file location.

    �:rr
N)
�os�path�isabs�splitr�atexit�register�closer�importlib_resources�files�
enter_context�as_file)r#�tokens�file_manager�ref�toks     r$�coerce_resource_to_filenamer7-s����7�7�=�=���C�5�L����S�!��!�{������*�*�+��(�(�.�.�v�a�y�9���!�"�:�C���)�C���*�*��&�&�.�.�s�3�
���L�c�X�tjj|�}tjj|�r|Stjj
|�\}}tjjD]+}tjj||z�s�&||zcSy)z,Given a python source path, locate the .pyc.N)	�	importlib�util�cache_from_sourcer(r)�exists�splitext�	machinery�BYTECODE_SUFFIXES)r)�	candidate�filepath�exts    r$�pyc_file_from_pathrDFs������0�0��6�I�	�w�w�~�~�i� ����G�G�$�$�T�*�M�H�c��"�"�4�4��
�7�7�>�>�(�S�.�)��c�>�!�5�r8c��tjdd|�}tjj	||�}tjj|�\}}|dk(rVtjj
|�rt||�}|St|�}|�td|z��t||�}|S|dvrt||�}|SJ�)z3Load a file from the given path as a Python module.z\W�_z.pyzCan't find Python file %s)z.pycz.pyo)
�re�subr(r)�joinr>r=�load_module_pyrD�ImportError)�dir_r�	module_idr)rFrC�module�pyc_paths        r$�load_python_filerPWs������u�c�8�,�I�
�7�7�<�<��h�'�D�
�W�W�
�
�h�
'�F�A�s�
�e�|�
�7�7�>�>�$��#�I�t�4�F��M�*�$�/�H���!�"=��"D�E�E�'�	�8�<��
�M�	

� �	 ��	�4�0���M�	�ur8c���tjj||�}|sJ�tjj|�}|jj|�|S)N)r:r;�spec_from_file_location�module_from_spec�loader�exec_module)rMr)�specrNs    r$rJrJmsJ���>�>�1�1�)�T�B�D��K�4�
�^�^�
,�
,�T�
2�F��K�K���F�#��Mr8)
r�strrrWrrWrr�return�None)r#rWrXrW)r)rWrXz
Optional[str])rLrWrrWrXr)rMrWr)rWrXr)�
__future__rr,�
contextlibrr:�importlib.machinery�importlib.utilr(rGr�typesr�typingrr�makor�
mako.templater	�r�excrr%r7rDrPrJrr8r$�<module>rdsv��"�
� ����	�	������"������!��47��?B��	��.�2�"�,r8

ZeroDay Forums Mini