Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/prompt_toolkit/layout/__pycache__/menus.cpython-39.pyc
Ðазад
a d�h;j � @ s� d dl mZ d dlZd dlmZ d dlmZmZmZm Z m Z mZ d dlm Z d dlmZ d dlmZ d dlmZ d d lmZ d d lmZmZmZmZmZ d dlmZmZmZ d dl m!Z! d d l"m#Z# d dl$m%Z%m&Z& d dl'm(Z( ddl)m*Z*m+Z+m,Z,m-Z- ddl.m/Z/m0Z0m1Z1 ddl2m3Z3 ddl4m5Z5 e�r:d dl6m7Z7m8Z8 ddgZ9e!Z:G dd� de1�Z;d,dddddd�d d!�Z<ddd"d#�d$d%�Z=G d&d� de*�Z>G d'd(� d(e1�Z?G d)d� de+�Z@G d*d+� d+e1�ZAdS )-� )�annotationsN)�zip_longest)� TYPE_CHECKING�Callable�Iterable�Sequence�TypeVar�cast)�WeakKeyDictionary)�get_app)�CompletionState)� Completion)�Point)� Condition�FilterOrBool�has_completions�is_done� to_filter)�StyleAndTextTuples�fragment_list_width�to_formatted_text)� KeyPressEvent)�explode_text_fragments)� MouseEvent�MouseEventType)� get_cwidth� )�ConditionalContainer�HSplit� ScrollOffsets�Window)�GetLinePrefixCallable� UIContent� UIControl)� Dimension)�ScrollbarMargin)�KeyBindings�NotImplementedOrNone�CompletionsMenu�MultiColumnCompletionsMenuc @ s� e Zd ZdZdZdd�dd�Zddd �d d�Zdddddd �dd�Zdddd�dd�Zddd�dd�Z dddd�dd�Z dddd�dd�Zddddd�d d!�Zd"d#d$�d%d&�Z d'S )(�CompletionsMenuControlaJ Helper for drawing the complete menu to the screen. :param scroll_offset: Number (integer) representing the preferred amount of completions to be displayed before and after the current one. When this is a very high number, the current completion will be shown in the middle most of the time. � �bool��returnc C s dS �NF� ��selfr0 r0 ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/prompt_toolkit/layout/menus.py� has_focus@ s z CompletionsMenuControl.has_focus�int� int | None��max_available_widthr. c C s6 t � jj}|r.| �d|�}| �d|�}|| S dS d S )Ni� r )r �current_buffer�complete_state�_get_menu_width�_get_menu_meta_width)r2 r8 r: � menu_width�menu_meta_widthr0 r0 r3 �preferred_widthC s z&CompletionsMenuControl.preferred_width�GetLinePrefixCallable | None��width�max_available_height� wrap_lines�get_line_prefixr. c C s t � jj}|rt|j�S dS d S �Nr )r r9 r: �len�completions)r2 rB rC rD rE r: r0 r0 r3 �preferred_heightM s z'CompletionsMenuControl.preferred_heightr"