https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/django/db/backends/sqlite3/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/django/db/backends/sqlite3/__pycache__/creation.cpython-310.pyc
o

3�a�@sDddlZddlZddlZddlmZddlmZGdd�de�ZdS)�N)�Path)�BaseDatabaseCreationc@sLeZdZedd��Zdd�Zddd�Zdd	�Zdd
d�Zdd
�Z	dd�Z
dS)�DatabaseCreationcCst|t�o
|dkp
d|vS)N�:memory:zmode=memory)�
isinstancer)�
database_name�r�E/usr/lib/python3/dist-packages/django/db/backends/sqlite3/creation.py�is_in_memory_dbs�z DatabaseCreation.is_in_memory_dbcCs,|jjddp	d}|dkrd|jjS|S)N�TEST�NAMErz)file:memorydb_%s?mode=memory&cache=shared)�
connection�
settings_dict�alias)�self�test_database_namerrr	�_get_test_db_namesz"DatabaseCreation._get_test_db_nameFc
Cs�|��}|r|S|�|�sd|dkr|�d|�||�f�t�|tj�rd|s,td|�}|s2|dkrZzt�|�W|St	yY}z|�d|�t
�d�WYd}~|Sd}~ww|�d�t
�d�|S)N��,Destroying old test database for alias %s...zXType 'yes' if you would like to try deleting the test database '%s', or 'no' to cancel: �yes�/Got an error deleting the old test database: %s�zTests cancelled.)rr
�log�_get_database_display_str�os�access�F_OK�input�remove�	Exception�sys�exit)r�	verbosity�autoclobber�keepdbr�confirm�errr	�_create_test_dbs8

������

z DatabaseCreation._create_test_dbcCsL|jj}|d}|�|�r|Stj�|d�\}}i|�dd�|||�i�S)Nrz{}_{}.{})r
rr
r�path�splitext�format)r�suffix�orig_settings_dict�source_database_name�root�extrrr	�get_test_db_clone_settings3s
z+DatabaseCreation.get_test_db_clone_settingsc
Cs�|jjd}|�|�d}|�|�s|t�|tj�rS|rdS|dkr-|�d|�||�f�zt�	|�Wnt
yR}z|�d|�t�d�WYd}~nd}~wwz	t
�||�WdSt
y{}z|�d|�t�d�WYd}~dSd}~wwdS)Nrrrrrz*Got an error cloning the test database: %s)r
rr0r
rrrrrrrr r!�shutil�copy)rr+r"r$r-�target_database_namer&rrr	�_clone_test_db<s2

������zDatabaseCreation._clone_test_dbcCs$|r|�|�st�|�dSdSdS)N)r
rr)rrr"rrr	�_destroy_test_dbTs�z!DatabaseCreation._destroy_test_dbcCsH|��}|jjdg}|�|�r|�|jj�t|�S|�|�t|�S)a 
        Return a tuple that uniquely identifies a test database.

        This takes into account the special cases of ":memory:" and "" for
        SQLite since the databases will be distinct despite having the same
        TEST NAME. See https://www.sqlite.org/inmemorydb.html
        r)rr
rr
�appendr�tuple)rr�sigrrr	�test_db_signatureYs

�z"DatabaseCreation.test_db_signatureN)F)�__name__�
__module__�__qualname__�staticmethodr
rr'r0r4r5r9rrrr	r	s


	r)rr1r �pathlibr� django.db.backends.base.creationrrrrrr	�<module>s

https://t.me/RX1948 - 2025