A file attachment to an IBug.
Launchpadlib example of accessing content of an attachment:
for attachment in bug.attachments:
buffer = attachment.data.open()
for line in buffer:
print line
buffer.close()
Launchpadlib example of accessing metadata about an attachment:
attachment = bug.attachments[0]
print "title:", attachment.title
print "ispatch:", attachment.type
For information about the file-like object returned by
attachment.data.open() see lazr.restfulclient's documentation of the
HostedFile object.
Details about the message associated with an attachment can be found on
the "message" attribute:
message = attachment.message
print "subject:", message.subject.encode('utf-8')
print "owner:", message.owner.display_name.encode('utf-8')
print "created:", message.date_created