[RFE attachmentbase.py|LPAttachment] make ATTACHMENTS.ATTACHMENT_PATH a property of LPAttachment
Bug #242317 reported by
Stephan Rügamer
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-launchpad-bugs |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Dear Colleagues,
please make ATTACHMENTS.
Thx,
\sh - Project Leonov :)
Related branches
Changed in python-launchpad-bugs: | |
status: | New → In Progress |
To post a comment you must log in.
This is how I implemented it in the intrepid.merge branch:
In [10]: from launchpadbugs. connector import ConnectBug
In [11]: Bug = ConnectBug()
In [12]: b = Bug(240685)
In [13]: b.attachments[0]
Out[13]: <Attachment (up: #15380150)>
In [14]: b.attachments[ 0].download_ to("/tmp/ boo/baz. diff")
In [15]: b.attachments[0]
Out[15]: <Attachment (up: #15380150), (down: /tmp/boo/baz.diff)>
In [16]: b.attachments[ 0].text /http_connectio n.py\'\ n--- launchpadbugs/ http_connection .py\t2008- 06-14 09:22:30 +0000\n+++ launchpadbugs/ http_connection .py\t2008- 06-17 14:38:10 +0000\n@@ -195,6 +195,12 @@\n assert callable( hook_func) , "hook_func needs to be callable with three arguments"\n self.__ progress_ hook = hook_func\n \n+ def save_cookie(self, filename):\n+ cj = cookielib. MozillaCookieJa r()\n+ for cookie in self.__ cookie_ handler. cookiejar: \n+ cj.set_ cookie( cookie) \n+ cj.save( filename) \n+ \n \n if __name__ == \'__main__\':\n c = HTTPConnection( )\n\n'
Out[16]: '=== modified file \'launchpadbugs
In [17]:
In [17]: print b.attachments[ 0].is_down
True
Markus