A utility class to retrieve the header and some lines of the body of a mail message.

Instance Variable f See __init__
Instance Variable n See __init__
Instance Variable linecount The number of full lines of the message body scanned. (type: int)
Instance Variable headers An indication of which part of the message is being scanned. True for the header and False for the body. (type: bool)
Instance Variable done A flag indicating when the desired part of the message has been scanned. (type: bool)
Instance Variable buf The portion of the message body that has been scanned, up to n lines. (type: bytes)
Method __init__
Method read Scan bytes from the file.
f =
See __init__
n =
See __init__
linecount =
The number of full lines of the message body scanned. (type: int)
headers =
An indication of which part of the message is being scanned. True for the header and False for the body. (type: bool)
done =
A flag indicating when the desired part of the message has been scanned. (type: bool)
buf =
The portion of the message body that has been scanned, up to n lines. (type: bytes)
def __init__(self, f, n): (source)
ParametersfA file containing a mail message. (type: file-like object)
nThe number of lines of the message body to retrieve. (type: int)
def read(self, bytes): (source)

Scan bytes from the file.

ParametersbytesThe number of bytes to read from the file. (type: int)
ReturnsEach portion of the header as it is scanned. Then, full lines of the message body as they are scanned. When more than one line of the header and/or body has been scanned, the result is the concatenation of the lines. When the scan results in no full lines, the empty string is returned. (type: bytes)
API Documentation for Twisted, generated by pydoctor at 2017-09-23 19:45:03.