관리-도구
편집 파일: highlighter.cpython-312.pyc
� G��ep% � �� � 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� Zej+ d� ej+ d� ej+ d� ej+ d� ej+ d� ej+ d� ej+ d� ej+ d� ej+ d� ej+ d � ej+ d!� ej+ d"� ej+ d#� ej+ d$� ej+ d%� ej+ d&� ej+ d'� ej+ d(� ej+ d)� d dlZej/ ej0 d*dd+��,� d�-� yy).� N)�ABC�abstractmethod)�List�Union� )�Span�Text�regexes�returnc �$ � dj | � S )z{Combine a number of regexes in to a single regex. Returns: str: New regex with all regexes ORed together. �|)�join)r s ��/builddir/build/BUILDROOT/alt-python312-pip-23.3.1-1.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/pip/_vendor/rich/highlighter.py�_combine_regexr s � � �8�8�G��� c �D � e Zd ZdZdeeef defd�Zededdfd�� Z y)�Highlighterz%Abstract base class for highlighters.�textr c � � t |t � rt |� }n/t |t � r|j � }nt d|��� �| j |� |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__ sQ � � �d�C� �!�$�Z�N� ��d� #�!�Y�Y�[�N��A�$��J�K�K����~�&��r Nc � � y)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 sC � �/��U�3��9�-� �$� �* ��d� �t� � �r r c � � e Zd ZdZdeddfd�Zy)�NullHighlighterzeA highlighter object that doesn't highlight. May be used to disable highlighting entirely. r r Nc � � y)z Nothing to doNr r s r r zNullHighlighter.highlight9 r! r )r"