관리-도구
편집 파일: messaging.cpython-38.pyc
U 0?�f� � @ s� d dl mZ d dlmZ d dlmZ d dlZd dlZd dlZd dl m Z d dl mZ d dl mZ d dl m Z d dlZd d lmZ d dlmZ e�e�Ze�d��e�� � z\d dlZd dlZd dlZe�d eje�d d d d d ��Ze�d e�\ZZ Z!Z"e d k�rdZ W n e#e$fk �r$ dZ Y nX dd�ddddd�dd�Z%ed/ddddd�dd��Z&d0dddd�dd�Z'ddd�d d!�Z(d1dd#dd$�d%d&�Z)d2dddddd(�d)d*�Z*d+dd,�d-d.�Z+dS )3� )�annotations)�Iterable)�contextmanagerN)�Iterator)�Optional)�TextIO)�Union)�url� )�sqla_compat�alembicZHHHHF��quietr zUnion[str, bytes]�bool�None)�stream�textr �returnc G sp |rd S t | dd�pd}|D ]N}t|t�s6|�|d�}|�|�}z| �|� W q tk rh Y qlY qX qd S )N�encoding�ascii�replace)�getattr� isinstance�bytes�encode�decode�write�OSError)r r r r �t� r �D/opt/hc_python/lib/python3.8/site-packages/alembic/util/messaging.py�write_outstream% s r! �strzIterator[None])� status_msg�newliner r c c sR t | d |d|d� z d V W n |s6ttjd� � Y nX |sNttjd� d S )Nz ...T)�flushr z FAILED z done )�msgr! �sys�stdout)r# r$ r r r r �status8 s r) )�messager r c C s* t �| � td| � �|d� t�d� d S )NzFAILED: r ���)�log�errorr&