Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/prompt_toolkit/formatted_text/__pycache__/base.cpython-39.pyc
Ðазад
a d�h* � @ s& d dl mZ d dlmZmZmZmZmZmZm Z m Z d dlmZ er\d dl mZ d dlmZ g d�Ze eeef eeeeegdf f f Zee Zer�d dl mZ G d d � d e�Ze ed eeg ef df Zd!ddddd�dd�Zddd�dd�ZG dd� de�ZG dd� d�Zddd�dd �ZdS )"� )�annotations)� TYPE_CHECKING�Any�Callable�Iterable�List�Tuple�Union�cast)� MouseEvent)�Protocol)�NotImplementedOrNone) �OneStyleAndTextTuple�StyleAndTextTuples�MagicFormattedText�AnyFormattedText�to_formatted_text�is_formatted_text�Template�merge_formatted_text� FormattedTextr )� TypeGuardc @ s e Zd ZdZdd�dd�ZdS )r zi Any object that implements ``__pt_formatted_text__`` represents formatted text. r ��returnc C s d S �N� ��selfr r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/prompt_toolkit/formatted_text/base.py�__pt_formatted_text__) � z(MagicFormattedText.__pt_formatted_text__N)�__name__� __module__�__qualname__�__doc__r r r r r r # s r N� Fr �str�boolr )�value�style�auto_convertr c s� | du rg }nvt | t�r$d| fg}n`t | t�r4| }nPt| d�rNtd| ��� }n6t| �rdt| � � d�S |rvd| � fg}ntd| ����� r�tt � fdd�|D ��}t |t �r�|S t |�S dS ) at Convert the given value (which can be formatted text) into a list of text fragments. (Which is the canonical form of formatted text.) The outcome is always a `FormattedText` instance, which is a list of (style, text) tuples. It can take a plain text string, an `HTML` or `ANSI` object, anything that implements `__pt_formatted_text__` or a callable that takes no arguments and returns one of those. :param style: An additional style string which is applied to all text fragments. :param auto_convert: If `True`, also accept other types, and convert them to a string first. Nr% r r �r) z[No formatted text. Expecting a unicode object, HTML, ANSI or a FormattedText instance. Got c s$ g | ]^}}� d | g|�R �qS )� r )�.0Z item_style�restr+ r r � <listcomp>_ r z%to_formatted_text.<locals>.<listcomp>)� isinstancer&