관리-도구
편집 파일: base.cpython-38.pyc
U 0?�f9� � @ s0 d dl mZ d dlmZ d dlZd dlZd dlZd dlZd dlZd dl m Z d dlmZ d dlm Z d dlmZ d dlmZ d d lmZ d d lmZ d dlmZ d dlmZ d d lmZ d dlmZ d dlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ e�rrddlmZ ddlm Z ddlm!Z! ddl"m#Z# ddl"m$Z$ ddl%m&Z& ddl%m'Z' z>ej(�r�d dl)m*Z* d d l)m+Z+ nd dl,m*Z* d d l,m+Z+ W n e-k �r� dZ*Y nX e�.d!�Z/e�.d"�Z0e�.d#�Z1e�.d$�Z2d%Z3e�.d&�Z4e�.d'�Z5G d(d)� d)�Z6G d*d+� d+ej!�Z7dS ),� )�annotations)�contextmanagerN)� ModuleType)�Any)�cast)�Iterator)�List)�Mapping)�Optional)�Sequence)�Set)�Tuple)� TYPE_CHECKING)�Union� ��revision)�write_hooks� )�util)� migration)�compat)�not_none)� _GetRevArg)� _RevIdType)�Revision)�Config)�MessagingOptions)�RevisionStep)� StampStep)�ZoneInfo)�ZoneInfoNotFoundErrorz (?!\.\#|__init__)(.*\.py)(c|o)?$z(?!\.\#|__init__)(.*\.py)$z([a-f0-9]+)\.py$z\w+z%(rev)s_%(slug)sz , *|(?: +)z , *|(?: +)|\:c @ s$ e Zd ZdZedddddddedej�f dddd d dddd dd d�dd�Ze dd�dd��Z ejdd�dd��Zdd�dd�Z edd d�dd��Zedhddddddd�d d!��Zdidddd$�d%d&�Zd'd(d)�d*d+�Zd,d-d)�d.d/�Zdd0d)�d1d2�Zdd3d)�d4d5�Zd6d6d7dd8�d9d:�Zdd�d;d<�Zd=d�d>d?�Zdd�d@dA�Zd=d�dBdC�ZdddDdE�dFdG�ZdddDdE�dHdI�ZdJdJdKdL�dMdN�Zd d�dOdP�Ze dd�dQdR��Z ddd7d dS�dTdU�Z!ddd dV�dWdX�Z"dd dY�dZd[�Z#d\d�d]d^�Z$djddd_d`d_dd_d7dadb� dcdd�Z%dddd\dde�dfdg�Z&dS )k�ScriptDirectoryaH Provides operations upon an Alembic script directory. This object is useful to get information as to current revisions, most notably being able to get at the "head" revision, for schemes that want to test if the current revision in the database is the most recent:: from alembic.script import ScriptDirectory from alembic.config import Config config = Config() config.set_main_option("script_location", "myapp:migrations") script = ScriptDirectory.from_config(config) head_revision = script.get_current_head() �( NF�utf-8r �strz Optional[int]zOptional[List[str]]�boolz Optional[str]zOptional[Mapping[str, str]]�None)�dir� file_template�truncate_slug_length�version_locations� sourceless�output_encoding�timezone�hook_config�recursive_version_locations�messaging_opts�returnc C sv || _ || _|| _|pd| _|| _|| _t�| j�| _ || _ || _| | _| | _ t�|tj�srt�dtj�|� ��d S )Nr# zVPath doesn't exist: %r. Please use the 'init' command to create a new scripts folder.)r( r) r+ r* r, r- r ZRevisionMap�_load_revisions�revision_mapr. r/ r0 r1 �os�access�F_OKr �CommandError�path�abspath)�selfr( r) r* r+ r, r- r. r/ r0 r1 � r<