Part of lp.bugs.interfaces.webservice View In Hierarchy
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 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
|Bool||is_patch||Is this attachment a patch?|
|Method||removeFromBug||Remove the attachment from the bug.|
|Method||destroySelf||Delete this record.|
|Method||getFileByName||Return the `ILibraryFileAlias for the given file name.|
Inherited from IHasBug: