Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/prompt_toolkit/layout/__pycache__/dimension.cpython-39.pyc
Ðазад
a d�h� � @ s� d Z ddlmZ ddlmZmZmZmZ g d�Zer@ddl m Z G dd� d�Zddd �d d�Zddd �dd �Z edeeeg ef f Zddd�dd�Zddd�dd�ZeZeZdS )zo Layout dimensions are used to give the minimum, maximum and preferred dimensions for containers and controls. � )�annotations)� TYPE_CHECKING�Any�Callable�Union)� Dimension�D�sum_layout_dimensions�max_layout_dimensions�AnyDimension�to_dimension�is_dimension)� TypeGuardc @ sj e Zd ZdZddddddd�dd�Zedd d �d d��Zed d�d d��Zdd�dd�Zdd�dd�Z dS )r a� Specified dimension (width/height) of a user control or window. The layout engine tries to honor the preferred size. If that is not possible, because the terminal is larger or smaller, it tries to keep in between min and max. :param min: Minimum size. :param max: Maximum size. :param weight: For a VSplit/HSplit, the actual size will be determined by taking the proportion of weights from all the children. E.g. When there are two children, one with a weight of 1, and the other with a weight of 2, the second will always be twice as big as the first, if the min/max values allow it. :param preferred: Preferred size. Nz int | None�None)�min�max�weight� preferred�returnc C s� |d ur|dksJ �|d u s(|dks(J �|d u s<|dks<J �|d u sP|dksPJ �|d u| _ |d u| _|d u| _|d u| _|d u r�d}|d u r�d}|d u r�|}|d u r�d}|| _|| _|| _|| _||k r�td��| j| jk r�| j| _| j| jkr�| j| _d S )Nr l �7�3M�e'� zInvalid Dimension: max < min.) � min_specified� max_specified�preferred_specified�weight_specifiedr r r r � ValueError)�selfr r r r � r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/prompt_toolkit/layout/dimension.py�__init__* s6 zDimension.__init__�int)�amountr c C s | |||d�S )zv Return a :class:`.Dimension` with an exact size. (min, max and preferred set to ``amount``). �r r r r )�clsr r r r �exactV s zDimension.exact)r c C s | j dd�S )zj Create a dimension that represents a zero size. (Used for 'invisible' controls.) r )r )r# )r"