관리-도구
편집 파일: highlighter.cpython-311.pyc
� �܋fq% � � � d dl Z d dlmZmZ d dlmZmZ ddlmZm Z de de fd�Z G d � d e� � Z G d� de� � Z G d � de� � Z G d� de� � Z G d� de� � Z G d� de� � Zedk �r�ddlmZ e� � Ze� d� � e� d� � e� d� � e� d� � e� d� � e� d� � e� d� � e� d� � e� d� � e� d � � e� d!� � e� d"� � e� d#� � e� d$� � e� d%� � e� d&� � e� d'� � e� d(� � e� d)� � d dlZe� ej d*dd+��,� � d�-� � dS dS ).� N)�ABC�abstractmethod)�List�Union� )�Span�Text�regexes�returnc �, � d� | � � S )z{Combine a number of regexes in to a single regex. Returns: str: New regex with all regexes ORed together. �|)�join)r s �S/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_vendor/rich/highlighter.py�_combine_regexr s � � �8�8�G���� c �R � e Zd ZdZdeeef defd�Zededdfd�� � Z dS )�Highlighterz%Abstract base class for highlighters.�textr c �� � t |t � � rt |� � }n<t |t � � r|� � � }nt d|��� � �| � |� � |S )a Highlight a str or Text instance. Args: text (Union[str, ~Text]): Text to highlight. Raises: TypeError: If not called with text or str. Returns: Text: A test instance with highlighting applied. z#str or Text instance required, not )� isinstance�strr �copy� TypeError� highlight)�selfr �highlight_texts r �__call__zHighlighter.__call__ su � � �d�C� � � L�!�$�Z�Z�N�N� ��d� #� #� L�!�Y�Y�[�[�N�N��J�$�J�J�K�K�K����~�&�&�&��r Nc � � dS )zoApply highlighting in place to text. Args: text (~Text): A text object highlight. N� �r r s r r zHighlighter.highlight) � � � � r ) �__name__� __module__�__qualname__�__doc__r r r r r r r r r r r ss � � � � � �/�/��U�3��9�-� �$� � � � �* ��d� �t� � � � �^�� � r r c �"