File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/pip/_vendor/rich/__pycache__/highlighter.cpython-310.pyc
Back
o ;jr% � @ s� d dl Z d dlmZmZ d dlmZmZ ddlmZm Z de de fdd �ZG d d� de�ZG dd � d e�Z G dd� de�ZG dd� de�ZG dd� de�ZG dd� de�Zedkr�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 dlZejejd+dd,�d-�dd.� dS dS )/� N)�ABC�abstractmethod)�List�Union� )�Span�Text�regexes�returnc G s d� | �S )z{Combine a number of regexes in to a single regex. Returns: str: New regex with all regexes ORed together. �|)�join)r � r �P/opt/saltstack/salt/lib/python3.10/site-packages/pip/_vendor/rich/highlighter.py�_combine_regex s r c @ s@ e Zd ZdZdeeef defdd�Zededdfdd��Z dS ) �Highlighterz%Abstract base class for highlighters.�textr c C sD t |t�r t|�}nt |t�r|�� }ntd|����| �|� |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 Zhighlight_textr r r �__call__ s zHighlighter.__call__Nc C � dS )zoApply highlighting in place to text. Args: text (~Text): A text object highlight. Nr �r r r r r r ) � zHighlighter.highlight) �__name__� __module__�__qualname__�__doc__r r r r r r r r r r r s r c @ s"