RPOS \ d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dlmZ ddlm Z dd lmZ dd lm Z ddlmZ erd dlmZ d d lmZ ddlmZ d@dZ dAdBdZ dCdDd)ZdEd+Z dFdGd.Z dHdId1Z dHdId2Zd3 Z dJdKd7ZdLd8ZdMd9ZdMdNd:Z dOdPd<Z!dQd>Z"dMdRd?Z#dS )S )annotationsN)List)Optional) TYPE_CHECKING)Union )autogenerate)util)EnvironmentContext)ScriptDirectory)Config)Script)ProcessRevisionDirectiveFnconfigr c | d t j | D ]}t t j | |d 5 }t | }ddd n# 1 swxY w Y | d|| | d | d dS )zNList available templates. :param config: a :class:`.Config` object. zAvailable templates: READMENz%s - %sz1 Templates are used via the 'init' command, e.g.:z, alembic init --template generic ./scripts) print_stdoutoslistdirget_template_directoryopenpathjoinnextrstrip)r tempnamereadmesynopsiss a/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/alembic/command.pylist_templatesr s& 0111Jv<<>>?? ; ; GLL6688(HMM - F||**,,H - - - - - - - - - - - - - - - Ix:::: LMMM GHHHHHs >"B,,B0 3B0 genericF directorystrtemplatepackageboolreturnNonec t j |t j r+t j | rt j d|z t j | | }t j |t j st j d|z t j |t j sct j dt j | fi | j 5 t j | ddd n# 1 swxY w Y t j |d }t j dt j | fi | j 5 t j | ddd n# 1 swxY w Y t | }d}t j | D ]}t j || } |dk r| j J t j | j }t j |t j rt j d|dfi | j | | || t j | r6t j || } | | | |rt j t j | d t j t j | d fD ]Y}t j di | j 5 t' |d 5 ddd n# 1 swxY w Y ddd n# 1 swxY w Y Z|J t j d |dfi | j dS )a Initialize a new scripts directory. :param config: a :class:`.Config` object. :param directory: string path of the target directory :param template: string name of the migration environment template to use. :param package: when True, write ``__init__.py`` files into the environment location as well as the versions/ location. .. versionadded:: 1.2 z,Directory %s already exists and is not emptyzNo such template %rzCreating directory Nversionszalembic.ini.makozFile z already exists, skipping)script_locationz__init__.pyAdding {path!r}wz9Please edit configuration/connection/logging settings in z before proceeding.)r, )r accessF_OKr r CommandErrorr r r statusabspathmessaging_optsmakedirsr config_file_namemsg_generate_templateisfile _copy_filer )r r" r$ r% template_dirr* scriptconfig_filefile_ file_pathoutput_filer s r initr@ ' s . yBG$$ I)>)> :YF 7<< = = ? ?JJL 9\27++ B 5 @AAA 9Y(( # [@"'//)"<"<@@ # # # K """ # # # # # # # # # # # # # # # w||Iz22H ;bgooh77;; H Y ' 'F"KL)) 6 6GLLu55 &&&*666'//&*ABBKybg.. DKDDD + )){I * W^^I & &