文件操作 - mime.cpython-311.pyc
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/python3/dist-packages/pygments/lexers/__pycache__/mime.cpython-311.pyc
编辑文件内容
� �E�cr � � � d Z ddlZddlmZmZ ddlmZ ddlmZm Z m Z mZmZm Z ddlmZmZ dgZ G d� de� � ZdS ) z� pygments.lexers.mime ~~~~~~~~~~~~~~~~~~~~ Lexer for Multipurpose Internet Mail Extensions (MIME) data. :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. � N)� RegexLexer�include)�get_lexer_for_mimetype)�Text�Name�String�Operator�Comment�Other)�get_int_opt� ClassNotFound� MIMELexerc �� � � e Zd ZdZdZdgZg d�Z� fd�Zd� Zd� Z d� Z d � Zd � Zd� Z dd hZdefde fgdej fdej dfg ed� � defdefdedfg ed� � de fgd�Z� xZS )r a_ Lexer for Multipurpose Internet Mail Extensions (MIME) data. This lexer is designed to process nested multipart data. It assumes that the given data contains both header and body (and is split at an empty line). If no valid header is found, then the entire data will be treated as body. Additional options accepted: `MIME-max-level` Max recursion level for nested MIME structure. Any negative number would treated as unlimited. (default: -1) `Content-Type` Treat the data as a specific content type. Useful when header is missing, or this lexer would try to parse from header. (default: `text/plain`) `Multipart-Boundary` Set the default multipart boundary delimiter. This option is only used when `Content-Type` is `multipart` and header is missing. This lexer would try to parse from header by default. (default: None) `Content-Transfer-Encoding` Treat the data as a specific encoding. Or this lexer would try to parse from header by default. (default: None) .. versionadded:: 2.5 �MIME�mime)zmultipart/mixedzmultipart/relatedzmultipart/alternativec � �� t � � j di |�� |� d� � | _ |� d� � | _ |� dd� � | _ t |dd� � | _ d S )NzMultipart-Boundary�Content_Transfer_Encoding�Content_Typez text/plainzMIME-max-level���� )�super�__init__�get�boundary�content_transfer_encoding�content_typer �max_nested_level)�self�options� __class__s ��6/usr/lib/python3/dist-packages/pygments/lexers/mime.pyr zMIMELexer.__init__; sz �� ������#�#�7�#�#�#����$8�9�9�� �)0���5P�)Q�)Q��&�#�K�K���E�E��� +�G�5E�r� J� J����� c # �T K � |� d� � }|� � � | j v r�|� d� � t j |dz fV � |� d� � t j |� d� � fV � |� d� � }|� d� � }| � |d|� � � f� � D ]\ }}}||z ||fV � �d S |� � � t |� � � fV � d S )N� �:� � �root)�group�lower�attention_headers�startr �Tagr � Whitespace�end�get_tokens_unprocessedr )r �match�field�pos�body�i�t�vs r! �get_header_tokenszMIMELexer.get_header_tokensB s � � � ����A�����;�;�=�=�D�2�2�2��+�+�a�.�.�$�(�E�C�K�7�7�7�7��+�+�a�.�.�$�/�5�;�;�q�>�>�A�A�A�A��)�)�A�,�,�C��;�;�q�>�>�D��6�6�t�f�e�k�k�m�m�=T�U�U� $� $���1�a��A�g�q�!�m�#�#�#�#� $� $� �+�+�-�-��%�+�+�-�-�7�7�7�7�7�7r"