Merge lp:~brendan-donegan/checkbox/fix_rerun into lp:checkbox

Proposed by Brendan Donegan on 2011-09-12
Status: Merged
Merged at revision: 1041
Proposed branch: lp:~brendan-donegan/checkbox/fix_rerun
Merge into: lp:checkbox
Diff against target: 47 lines (+8/-1)
3 files modified
debian/changelog (+1/-0)
plugins/jobs_prompt.py (+5/-1)
plugins/recover_prompt.py (+2/-0)
To merge this branch: bzr merge lp:~brendan-donegan/checkbox/fix_rerun
Reviewer Review Type Date Requested Status
Marc Tardif (community) 2011-09-12 Approve on 2011-09-12
Review via email: mp+74953@code.launchpad.net

Description of the change

This merge adds an event called 'reset-jobs' to the jobs_prompt plugin which call delete_all_jobs. This is only fired when the user selects 'No' in the dialog opened by the resource_prompt plugin.

To post a comment you must log in.
1039. By Brendan Donegan on 2011-09-12

Update debian/changelog ;)

Marc Tardif (cr3) wrote :

Looks good and I like how you called delete_all_jobs instead of literally deleting the store directory. I made a small change to pass a boolean value to the begin-recover event specifying whether the user wants to recover or not. This made it possible to avoid introducing the reset-jobs event and keep the recover_prompt plugin agnostic of the concept of jobs. Merging!

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 2011-09-09 19:15:50 +0000
3+++ debian/changelog 2011-09-12 12:37:36 +0000
4@@ -2,6 +2,7 @@
5
6 [Brendan Donegan]
7 * Redirecting stderr to pipe to fix the gconf_resource script (LP: #832321)
8+ * Clear jobs directory when user selects No to recover question (LP: #836623)
9
10 [Marc Tardif]
11 * Only connecting hyper text widgets once (LP: #827904)
12
13=== modified file 'plugins/jobs_prompt.py'
14--- plugins/jobs_prompt.py 2011-07-22 09:17:17 +0000
15+++ plugins/jobs_prompt.py 2011-09-12 12:37:36 +0000
16@@ -62,7 +62,8 @@
17 ("prompt-jobs", self.prompt_jobs),
18 ("prompt-finish", self.prompt_finish),
19 ("report", self.report),
20- ("report-job", self.report_job)]:
21+ ("report-job", self.report_job),
22+ ("reset-jobs", self.reset_jobs)]:
23 self._manager.reactor.call_on(rt, rh)
24
25 def expose_msgstore(self):
26@@ -109,6 +110,9 @@
27 if interface.direction == NEXT:
28 self.store.delete_all_messages()
29
30+ def reset_jobs(self):
31+ self.store.delete_all_messages()
32+
33 def report(self):
34 self.store.set_pending_offset(0)
35 messages = self.store.get_pending_messages()
36
37=== modified file 'plugins/recover_prompt.py'
38--- plugins/recover_prompt.py 2011-02-02 21:48:35 +0000
39+++ plugins/recover_prompt.py 2011-09-12 12:37:36 +0000
40@@ -56,6 +56,8 @@
41 ["yes", "no"], "yes")
42 if response == "yes":
43 self._manager.reactor.fire("begin-recover")
44+ elif response == "no":
45+ self._manager.reactor.fire("reset-jobs")
46
47 self.persist.set("recover", True)
48

Subscribers

People subscribed via source and target branches