| Server IP : 217.160.0.135 / Your IP : 216.73.217.25 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3/dist-packages/prompt_toolkit/layout/__pycache__/ |
Upload File : |
�
�Ïc� � �� � d Z ddlmZmZmZmZmZmZ g d�Zerddl m
Z
G d� d� � Zdee defd �Zdee defd
�Z
edeeeg ef f Zdedefd
�Zdeddfd�ZeZeZdS )zo
Layout dimensions are used to give the minimum, maximum and preferred
dimensions for containers and controls.
� )�
TYPE_CHECKING�Any�Callable�List�Optional�Union)� Dimension�D�sum_layout_dimensions�max_layout_dimensions�AnyDimension�to_dimension�is_dimension)� TypeGuardc � � e Zd ZdZ ddee dee dee dee ddf
d�Zed edd fd
�� � Zedd�� � Z de
fd�Zdefd
�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.
N�min�max�weight� preferred�returnc � � |�|dk sJ �|�|dk sJ �|�|dk sJ �|�|dk sJ �|d u| _ |d u| _ |d u| _ |d u| _ |�d}|�d}|�|}|�d}|| _ || _ || _ || _ ||k rt d� � �| j | j k r| j | _ | j | j k r| j | _ d S 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 s �A/usr/lib/python3/dist-packages/prompt_toolkit/layout/dimension.py�__init__zDimension.__init__'