관리-도구
편집 파일: align.cpython-38.pyc
U &?�f�( � @ sf d dl Z d dlmZ d dlmZmZmZ e jdkr@d dlmZ nd dl mZ ddl mZ ddlm Z dd lmZ dd lmZ ddlmZ er�ddlmZmZmZmZ ed Zed ZG dd� de �ZG dd� de �Zedk�rbd dlmZmZ d dl m!Z! d dl"m#Z# e!� Z$e� Ze#ee�%e$d��e�&e$d��e�'e$d���dddd�Z(e�)ej&e(ddej*d�� dS ) � N)�chain)� TYPE_CHECKING�Iterable�Optional)� � )�Literal� )� Constrain)�JupyterMixin)�Measurement)�Segment)� StyleType)�Console�ConsoleOptions�RenderableType�RenderResult��left�center�right��top�middle�bottomc @ s0 e Zd ZdZdddddd�deee ee eee ee dd�dd �Z ed �dd�Ze dddddd�dee ee eee ee d d �dd��Ze dddddd�dee ee eee ee d d �dd��Ze dddddd�dee ee eee ee d d �dd��Zdddd�dd�Zdded�dd�ZdS ) �Aligna Align a renderable by adding spaces if necessary. Args: renderable (RenderableType): A console renderable. align (AlignMethod): One of "left", "center", or "right"" style (StyleType, optional): An optional style to apply to the background. vertical (Optional[VerticalAlignMethod], optional): Optional vertical align, one of "top", "middle", or "bottom". Defaults to None. pad (bool, optional): Pad the right with spaces. Defaults to True. width (int, optional): Restrict contents to given width, or None to use default width. Defaults to None. height (int, optional): Set height of align renderable, or None to fit to contents. Defaults to None. Raises: ValueError: if ``align`` is not one of the expected values. r NT)�vertical�pad�width�heightr )� renderable�align�styler r r r �returnc C sf |dkrt d|�d���|d k r8|dkr8t d|�d���|| _|| _|| _|| _|| _|| _|| _d S )Nr zDinvalid value for align, expected "left", "center", or "right" (not �)r zGinvalid value for vertical, expected "top", "middle", or "bottom" (not )� ValueErrorr r! r"