class documentation
class _HeadersPlusNLines: (source)
Constructor: _HeadersPlusNLines(file, extraLines)
A utility class to retrieve the header and some lines of the body of a mail message.
Method | __init__ |
No summary |
Method | read |
Scan bytes from the file. |
Instance Variable | buf |
The portion of the message body that has been scanned, up to n lines. |
Instance Variable | done |
A flag indicating when the desired part of the message has been scanned. |
Instance Variable | headers |
An indication of which part of the message is being scanned. True for the header and False for the body. |
Instance Variable | linecount |
The number of full lines of the message body scanned. |
Instance Variable | _extra |
See __init__ |
Instance Variable | _file |
See __init__ |
Parameters | |
file:file-like object | A file containing a mail message. |
extraint | The number of lines of the message body to retrieve. |
Scan bytes from the file.
Parameters | |
bytes:int | The number of bytes to read from the file. |
Returns | |
bytes | Each 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. |