class documentation

class MIMELexer(RegexLexer):

View In Hierarchy

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)
New in version 2.5.
Method __init__ Undocumented
Method get​_body​_tokens Undocumented
Method get​_bodypart​_tokens Undocumented
Method get​_content​_type​_subtokens Undocumented
Method get​_header​_tokens Undocumented
Method store​_content​_transfer​_encoding Undocumented
Method store​_content​_type Undocumented
Class Variable aliases Undocumented
Class Variable attention​_headers Undocumented
Class Variable mimetypes Undocumented
Class Variable name Undocumented
Class Variable tokens Undocumented
Instance Variable boundary Undocumented
Instance Variable content​_transfer​_encoding Undocumented
Instance Variable content​_type Undocumented
Instance Variable max​_nested​_level Undocumented

Inherited from RegexLexer:

Method get​_tokens​_unprocessed Split text into (tokentype, text) pairs.

Inherited from Lexer (via RegexLexer):

Method analyse​_text No summary
Method get​_tokens Return an iterable of (tokentype, value) pairs generated from text. If unfiltered is set to True, the filtering mechanism is bypassed even if filters are defined.
Class Variable alias​_filenames Undocumented
Class Variable filenames Undocumented
Method __repr__ Undocumented
Method add​_filter Add a new stream filter to this lexer.
Class Variable priority Undocumented
Instance Variable encoding Undocumented
Instance Variable ensurenl Undocumented
Instance Variable filters Undocumented
Instance Variable options Undocumented
Instance Variable stripall Undocumented
Instance Variable stripnl Undocumented
Instance Variable tabsize Undocumented
def __init__(self, **options):

Undocumented

def get_body_tokens(self, match):

Undocumented

def get_bodypart_tokens(self, text):

Undocumented

def get_content_type_subtokens(self, match):

Undocumented

def get_header_tokens(self, match):

Undocumented

def store_content_transfer_encoding(self, match):

Undocumented

def store_content_type(self, match):

Undocumented

aliases: list[str] =

Undocumented

attention_headers: set[str] =

Undocumented

mimetypes: list[str] =

Undocumented

name: str =

Undocumented

tokens =

Undocumented

boundary =

Undocumented

content_transfer_encoding =

Undocumented

content_type =

Undocumented

max_nested_level =

Undocumented