HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/pygments/formatters/__pycache__/__init__.cpython-310.pyc
o

���a��@s�dZddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZgd�e
e�ZiZiZdd	�Zd
d�Zdd
�Zdd�Zdd�Zddd�Zdd�ZGdd�dej�ZejeZee�Zej�ej�eeje<e`e`e`e`dS)z�
    pygments.formatters
    ~~~~~~~~~~~~~~~~~~~

    Pygments formatters.

    :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�basename)�
FORMATTERS)�find_plugin_formatters)�
ClassNotFound)�get_formatter_by_name�get_formatter_for_filename�get_all_formatters�load_formatter_from_filecCs8|tvrt�t�|��}t|<|�|�St|�|�S)zBReturn whether the supplied file name fn matches pattern filename.)�_pattern_cache�re�compile�fnmatch�	translate�match)�fn�glob�pattern�r�>/usr/lib/python3/dist-packages/pygments/formatters/__init__.py�_fn_matchess
rcCs4t|dddg�}|jD]}t||�}|t|j<qdS)z4Load a formatter (and all others in the module too).N�__all__)�
__import__r�getattr�_formatter_cache�name)�module_name�mod�formatter_name�clsrrr�_load_formatters$s


�rccsP�t��D]}|dtvrt|d�t|dVqt�D]\}}|VqdS)z-Return a generator for all formatter classes.�rN)r�valuesrrr)�info�_�	formatterrrrr,s��rcCsbt��D]\}}}}}||vr|tvrt|�t|Sqt�D]
\}}||jvr.|Sq!dS)zALookup a formatter by alias.

    Returns None if not found.
    N)rr!rrr�aliases)�aliasrrr%r#rrrr�find_formatter_class7s�
��r'cKs*t|�}|durtd|��|di|��S)zYLookup and instantiate a formatter by alias.

    Raises ClassNotFound if not found.
    Nzno formatter found for name %rr)r'r)�_alias�optionsrrrrrFsr�CustomFormatterc
Ks�z6i}t|d��}t|��|�Wd�n1swY||vr+td||f��||}|di|��WStyJ}ztd||f��d}~wtyQ�tyb}ztd|��d}~ww)a!Load a formatter from a file.

    This method expects a file located relative to the current working
    directory, which contains a class named CustomFormatter. By default,
    it expects the Formatter to be named CustomFormatter; you can specify
    your own class name as the second argument to this function.

    Users should be very careful with the input, because this method
    is equivalent to running eval on the input file.

    Raises ClassNotFound if there are any problems importing the Formatter.

    .. versionadded:: 2.2
    �rbNzno valid %s class found in %szcannot read %s: %sz'error when loading custom formatter: %sr)�open�exec�readr�OSError�	Exception)�filename�
formatternamer)�custom_namespace�f�formatter_class�errrrrr	Qs(�����r	cKs�t|�}t��D]&\}}}}}|D]}t||�r-|tvr t|�t|di|��Sqqt�D]}|jD]}t||�rI|di|��Sq7q2td|��)zdLookup and instantiate a formatter by filename pattern.

    Raises ClassNotFound if not found.
    z#no formatter found for file name %rNr)	rrr!rrrr�	filenamesr)rr)�modnamerr#r7r1rrrrrus 
��


��rc@seZdZdZdd�ZdS)�_automodulez Automatically import formatters.cCs>t�|�}|rt|d�t|d}t|||�|St|��)Nrr )r�getrr�setattr�AttributeError)�selfrr"rrrr�__getattr__�s
z_automodule.__getattr__N)�__name__�
__module__�__qualname__�__doc__r>rrrrr9�sr9)r*) rBr�sys�typesr
�os.pathr�pygments.formatters._mappingr�pygments.pluginr�
pygments.utilr�listrrr
rrrr'rr	r�
ModuleTyper9�modulesr?�oldmod�newmod�__dict__�updaterrrr�<module>s6
�
$