class documentation

class FileWrapper: (source)

Implements interfaces: twisted.mail.interfaces.IMessageSMTP

View In Hierarchy

A message receiver which delivers a message to a file.
Method __init__
Method __str__ Build a string representation of this FileWrapper instance.
Method connectionLost Close the temporary file when the connection is lost.
Method eomReceived Handle end of message by writing the message to the file.
Method lineReceived Write a received line to the temporary file.
Instance Variable finalname The name of the file in which the message should be stored.
Instance Variable fp A file used for temporary storage of the message.
def __init__(self, filename): (source)
Parameters
filename:bytesThe name of the file in which the message should be stored.
def __str__(self): (source)
Build a string representation of this FileWrapper instance.
Returns
bytesA string containing the file name of the message.
def connectionLost(self): (source)
Close the temporary file when the connection is lost.
def eomReceived(self): (source)
Handle end of message by writing the message to the file.
Returns
Deferred which successfully results in bytesA deferred which succeeds with the name of the file to which the message has been stored or fails if the message cannot be saved to the file.
def lineReceived(self, line): (source)
Write a received line to the temporary file.
Parameters
line:bytesA received line of the message.
finalname: bytes = (source)
The name of the file in which the message should be stored.
fp: file-like object = (source)
A file used for temporary storage of the message.