https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/pygments/formatters/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/pygments/formatters/__pycache__/groff.cpython-310.pyc
o

���au�@sBdZddlZddlmZddlmZmZdgZGdd�de�ZdS)z�
    pygments.formatters.groff
    ~~~~~~~~~~~~~~~~~~~~~~~~~

    Formatter for groff output.

    :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�	Formatter)�get_bool_opt�get_int_opt�GroffFormatterc@sXeZdZdZdZgd�ZgZdd�Zdd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
dS)ra
    Format tokens with groff escapes to change their color and font style.

    .. versionadded:: 2.11

    Additional options accepted:

    `style`
        The style to use, can be a string or a Style subclass (default:
        ``'default'``).

    `monospaced`
        If set to true, monospace font will be used (default: ``true``).

    `linenos`
        If set to true, print the line numbers (default: ``false``).

    `wrap`
        Wrap lines to the specified number of characters. Disabled if set to 0
        (default: ``0``).
    �groff)r�troff�roffcKsZtj|fi|��t|dd�|_t|dd�|_d|_t|dd�|_d|_i|_	|�
�dS)N�
monospacedT�linenosFr�wrap)r�__init__rr	r
�_linenorr�_linelen�styles�_make_styles)�self�options�r�;/usr/lib/python3/dist-packages/pygments/formatters/groff.pyr-szGroffFormatter.__init__cCs�|jrdnd}|jrdnd}|jrdnd}|jD]G\}}d}}|dr0|d	|d7}d
|}|dr<||7}||}|drH||7}||}|d
rX|d|d
7}d|}||f|j|<qdS)Nz\f[CR]z\f[R]z\f[CB]z\f[B]z\f[CI]z\f[I]��colorz\m[%s]z\m[]�bold�italic�bgcolorz\M[%s]z\M[])r	�styler)r�regularrr�ttype�ndef�start�endrrrr:s&�zGroffFormatter._make_stylescCsXt�}|jD]\}}|ddur|�|d�q|D]}|�d|d|d�qdS)Nrz
.defcolor z rgb #�
)�setr�add�write)r�outfile�colors�_rrrrr�_define_colorsQs��zGroffFormatter._define_colorscCs4|jd7_|�d|jdkrdpd|jf�dS)N�z%s% 4d r r)r
r#)rr$rrr�
_write_lineno[s&zGroffFormatter._write_linenocCs�t|�d��}|jrdnd}d}||jkrStdt�||j��D]}|||j||j|j�}||d|7}q ||j}|dkrQ|||dd�7}||_|S|j||jkrfd||}||_|S|}|j|7_|S)Nr z     rrr()�len�rstripr
r�range�math�floorr)r�line�length�space�newline�i�chunk�	remainderrrr�
_wrap_line`s&

��zGroffFormatter._wrap_linecCs�|�dd��dd��dd��dd��d	d
�}|}|D]+}t|�t|���krE|�d���dd��d
d���}|�|d|dd�d�}q|S)N�\z\[u005C]�.z	\[char46]�'z\[u0027]�`z\[u0060]�~z\[u007E]�unicode_escaper(�x�u00z\[u�])�replacer*�encode�decode�upper)r�text�copy�char�unirrr�
_escape_charsws$
�
���zGroffFormatter._escape_charsc		Cs�|�|�|�d�|jr|�|�|D]]\}}|j|\}}|�d�D]L}|jdkr0|�|�}|rL|rL|�|�	d��}|dkrK|�d�
|||f��n|�|�|�	d���|�d�rp|jrh|�|�d|_q$|�d�d|_q$q|�d�dS)Nz.nf
\f[CR]
Trr rz
.fi)
r'r#r
r)r�
splitlinesrr6rHr+�join�endswithr)	r�tokensourcer$r�valuerrr/rDrrr�format_unencoded�s0




�


��zGroffFormatter.format_unencodedN)�__name__�
__module__�__qualname__�__doc__�name�aliases�	filenamesrrr'r)r6rHrNrrrrrs

)	rRr-�pygments.formatterr�
pygments.utilrr�__all__rrrrr�<module>s


https://t.me/RX1948 - 2025