App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | Public Attributes | List of all members
google.appengine.api.mail.Attachment Class Reference
Inheritance diagram for google.appengine.api.mail.Attachment:

Public Member Functions

def __init__
 
def __eq__
 
def __hash__
 
def __ne__
 
def __iter__
 
def __getitem__
 
def __contains__
 
def __len__
 

Public Attributes

 filename
 
 payload
 
 content_id
 

Detailed Description

Attachment object.

An Attachment object is largely interchangeable with a (filename, payload)
tuple.

Note that the behavior is a bit asymmetric with respect to unpacking and
equality comparison. An Attachment object without a content ID will be
equivalent to a (filename, payload) tuple. An Attachment with a content ID
will unpack to a (filename, payload) tuple, but will compare unequally to
that tuple.

Thus, the following comparison will succeed:

    attachment = mail.Attachment('foo.jpg', 'data')
    filename, payload = attachment
    attachment == filename, payload

...while the following will fail:

    attachment = mail.Attachment('foo.jpg', 'data', content_id='<foo>')
    filename, payload = attachment
    attachment == filename, payload

 The following comparison will pass though:

    attachment = mail.Attachment('foo.jpg', 'data', content_id='<foo>')
    attachment == (attachment.filename,
                   attachment.payload,
                   attachment.content_id)

Attributes:
  filename: The name of the attachment.
  payload: The attachment data.
  content_id: Optional. The content-id for this attachment. Keyword-only.

Constructor & Destructor Documentation

def google.appengine.api.mail.Attachment.__init__ (   self,
  filename,
  payload,
  content_id = None 
)
Constructor.

Arguments:
  filename: The name of the attachment
  payload: The attachment data.
  content_id: Optional. The content-id for this attachment.

The documentation for this class was generated from the following file: