Merge lp:~james-w/bughugger/fix-api-usage into lp:bughugger

Proposed by James Westby
Status: Merged
Merged at revision: not available
Proposed branch: lp:~james-w/bughugger/fix-api-usage
Merge into: lp:bughugger
Diff against target: 49 lines (+9/-3)
3 files modified
debian/changelog (+4/-0)
plugins/PluginCollectIt.py (+2/-1)
plugins/PluginDuplicate.py (+3/-2)
To merge this branch: bzr merge lp:~james-w/bughugger/fix-api-usage
Reviewer Review Type Date Requested Status
Brian Murray Approve
Review via email: mp+22536@code.launchpad.net

Description of the change

Hi,

The LP API has changed to use attributes rather than methods
for setting the status and duplicates.

This change allows it to work with the new API form (which is
also permitted by the old API, so there aren't any compatibility
worries).

Thanks,

James

To post a comment you must log in.
Revision history for this message
Leonard Richardson (leonardr) wrote :

Though I don't have authority to approve this branch, I've reviewed it and confirmed that there are no other compatibility issues in the current bughugger.

Revision history for this message
Brian Murray (brian-murray) wrote :

Thanks for doing this!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-03-15 23:14:54 +0000
3+++ debian/changelog 2010-03-31 14:24:24 +0000
4@@ -1,7 +1,11 @@
5 bughugger (10.03) UNRELEASED; urgency=low
6
7+ [ Brian Murray ]
8 * bin/bughugger: make releases in a json data file a list too
9
10+ [ James Westby ]
11+ * Fix two plugins to work with the LP 1.0 API.
12+
13 -- Brian Murray <brian@ubuntu.com> Mon, 15 Mar 2010 16:13:09 -0700
14
15 bughugger (10.02) lucid; urgency=low
16
17=== modified file 'plugins/PluginCollectIt.py'
18--- plugins/PluginCollectIt.py 2010-02-03 02:17:01 +0000
19+++ plugins/PluginCollectIt.py 2010-03-31 14:24:24 +0000
20@@ -31,8 +31,9 @@
21 for bug_task in bug_tasks:
22 # not for each task of a bug but the list of tasks passed to the Plugin
23 comment = "Thank you for taking the time to report this bug and helping to make Ubuntu better. Please execute the following command, as it will automatically gather debugging information, in a terminal:\n\napport-collect %s\n\nThis will help us to find and resolve the problem. Bear in mind that you may need to install the python-launchpadlib package from the universe repository. Additionally, when prompted to give apport-collect permissions for Launchpad you will need to give it at least the ability to \"Change Non-Private\" data as it will be adding information to your bug report. Thanks in advance!" % (bug_task.bug.id)
24- bug_task.transitionToStatus(status="Incomplete")
25 bug_task.bug.newMessage(content=comment, subject="Request for information")
26+ bug_task.status = "Incomplete"
27+ bug_task.lp_save()
28
29 @property
30 def hide(self):
31
32=== modified file 'plugins/PluginDuplicate.py'
33--- plugins/PluginDuplicate.py 2010-02-03 02:17:01 +0000
34+++ plugins/PluginDuplicate.py 2010-03-31 14:24:24 +0000
35@@ -59,11 +59,12 @@
36 if bug_task.bug.duplicates:
37 print "Skipping bug LP: #%s as it has duplicates itself" % (bug_task.bug.id)
38 continue
39- bug_task.transitionToStatus(status="Confirmed")
40 bug_task.bug.newMessage(content=comment, subject="Marking as a duplicate")
41
42 master_bug = self.launchpad.bugs[master]
43- bug_task.bug.markAsDuplicate(duplicate_of=master_bug)
44+ bug_task.bug.duplicate_of = master_bug
45+ bug_task.status = "Confirmed"
46+ bug_task.lp_save()
47
48 @property
49 def hide(self):

Subscribers

People subscribed via source and target branches

to all changes: