관리-도구
편집 파일: pygmentsformatter.cpython-311.pyc
� P�DgI � � � d Z ddlZddlZ G d� dej j � � Z G d� de� � Z G d� de� � ZdS ) z. Additional support for Pygments formatter. � Nc � � e Zd Zd� Zdd�ZdS )�OdtPygmentsFormatterc �j � t j j � | � � || _ || _ d S �N)�pygments� formatter� Formatter�__init__�rststyle_function�escape_function)�selfr r s ��/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/docutils/writers/odf_odt/pygmentsformatter.pyr zOdtPygmentsFormatter.__init__ s2 � ���$�-�-�d�3�3�3�!2���.����� � c �. � | � ||� � S r )r )r �name� parameterss r �rststylezOdtPygmentsFormatter.rststyle s � ��%�%�d�J�7�7�7r N)r )�__name__� __module__�__qualname__r r r r r r r s7 � � � � � �/� /� /� 8� 8� 8� 8� 8� 8r r c � � e Zd Zd� ZdS )�OdtPygmentsProgFormatterc � � t j j }|D �]�\ }}| � |� � }||j k r | � d� � }d|�d|�d�}�n�||j j k r | � d� � }d|�d|�d�}�na||j j j |j j j j |j j j |j j j |j j j |j j fv r| � d� � }d|�d|�d�}n�||j k r| � d� � }d|�d|�d�}n�||j k r| � d� � }d|�d|�d�}n�||j j k r| � d � � }d|�d|�d�}n[||j j k r| � d � � }d|�d|�d�}n,||j k r| � d� � }d|�d|�d�}n|}|� |� � ���d S )N�codeblock-keyword�<text:span text:style-name="�">�</text:span>�codeblock-stringzcodeblock-number�codeblock-operator�codeblock-commentzcodeblock-classnamezcodeblock-functionname�codeblock-name)r �token�Tokenr �Keywordr �Literal�String�Number�Integer�Long�Float�Hex�Oct�Operator�Comment�Name�Class�Function�write�r �tokensource�outfile� tokenclass�ttype�value�s2�s1s r �formatzOdtPygmentsProgFormatter.format sm � ��^�)� �'� + � + �L�E�5��(�(��/�/�E�� �*�*�*��]�]�#6�7�7����R�R����"����*�,�3�3�3��]�]�#5�6�6����R�R����"�����&�-�5��&�-�5�:��&�-�3��&�-�1��&�-�1��&�-� � � � �]�]�#5�6�6����R�R����"����*�-�-�-��]�]�#7�8�8����R�R����"����*�,�,�,��]�]�#6�7�7����R�R����"����*�/�/�/�/��]�]�#8�9�9����R�R����"����*�/�2�2�2��]�]�#;�<�<����R�R����"����*�/�)�)��]�]�#3�4�4����R�R����"��� ���M�M�"�����W+ � + r N�r r r r<