%PDF- %PDF-
Direktori : /usr/lib/python3/dist-packages/rich/__pycache__/ |
Current File : //usr/lib/python3/dist-packages/rich/__pycache__/highlighter.cpython-312.pyc |
� "T�eq% � �� � 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 �2/usr/lib/python3/dist-packages/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"