Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`mail`.`alias`.`FileWrapper``

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__` | No summary
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:`bytes` | The name of the file in which the message should be stored.

def __str__(self): (source)

Build a string representation of this `FileWrapper` instance.

Returns
`bytes` | A string containing the file name of the message.

def connectionLost(self): (source)
from `twisted.mail.interfaces.IMessageSMTP`

Close the temporary file when the connection is lost.

def eomReceived(self): (source)
from `twisted.mail.interfaces.IMessageSMTP`

Handle end of message by writing the message to the file.

Returns
`Deferred` which successfully results in `bytes` | A 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)
from `twisted.mail.interfaces.IMessageSMTP`

Write a received line to the temporary file.

Parameters
line:`bytes` | A 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.