관리-도구
편집 파일: provision.cpython-38.pyc
U -?�f � @ sl d dl Z d dlZddlmZ ddlmZ ddlmZ ddlm Z ddlm Z ddlmZ dd lmZ dd lm Z ddlmZ ddlmZ dd lmZ ddlmZ dddddhZdd� Ze�d�dd� �Ze �d�dd� �Ze �d�dd� �Ze�d�dd� �Ze �d�dd � �Zd!d"� Ze�d�d#d$� �Ze�d�d%d&� �Ze�d�d'd(� �Ze�d�dd)d*�d+d,��ZdS )-� N� )�exc)�url)� create_db)�drop_db)�follower_url_from_main)�generate_driver_url)�log)�post_configure_engine)�run_reap_dbs)� stop_test_class_outside_fixtures)�temp_table_keyword_args)�upsertZpysqliteZ aiosqlite�pysqlcipherZpysqlite_numericZpysqlite_dollarc C s t �| �} |dkr| �� }| j}|dk}d}|r�|dkr�d|ksDt�t�d|�}|� }|D ]:}|tkrv|dkrZ|}qZqZ|dkr�qZqZ|dkrZ|�d�}qZ|s�td| j� ���|� d|� �}|r�|d|� �7 }|d 7 }|r�|d 7 }| j |d�} |r�| j dd �} | j d|f d�} | S )zUgiven a sqlite url + desired driver + ident, make a canonical URL out of it Nr �:memory:Ztest_schemaz[_\.])�db�enc�_z#sqlite filename has no name token: �.dbz.enc)�database�test)�passwordz sqlite+%s)� drivername) �sa_url�make_urlZget_driver_namer �AssertionError�re�split�_drivernames�strip�set) r �driver�ident�filenameZ needs_enc� name_token�tokensZnew_filename�token� r'