Merge ~kissiel/plainbox:sa-selection-midway into plainbox:master

Proposed by Maciej Kisielewski
Status: Merged
Approved by: Maciej Kisielewski
Approved revision: 5bce0dc4fbb1527a959a1cf1e0cf72cceb2c83d0
Merged at revision: 1573939c6e69ce858b6788f4581d9fa2b73ee900
Proposed branch: ~kissiel/plainbox:sa-selection-midway
Merge into: plainbox:master
Diff against target: 12 lines (+1/-0)
1 file modified
plainbox/impl/session/assistant.py (+1/-0)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+329445@code.launchpad.net

Description of the change

SessionAssistant: allow sa.hand_pick_jobs in the main loop

This allows apps to re-apply selection patterns after some jobs were run,
thus generating new selection (list of strings matching ids).

Concrete mechanics:
    start session;
    call hand_pick_jobs('.*') (selecting all _existing_ jobs)
    run resource job that generates a new job that matches above pattern
    (*NEW*) call hand_pick_jobs() again to apply the filter to the new state
    run freshly instantiated jobs
    profit!

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/plainbox/impl/session/assistant.py b/plainbox/impl/session/assistant.py
2index 253625f..5a72bb1 100644
3--- a/plainbox/impl/session/assistant.py
4+++ b/plainbox/impl/session/assistant.py
5@@ -1701,6 +1701,7 @@ class SessionAssistant:
6 self.get_dynamic_todo_list: "to see what is yet to be executed",
7 self.run_job: "to run a given job",
8 self.use_alternate_selection: "to change the selection",
9+ self.hand_pick_jobs: "to generate new selection and use it",
10 self.use_job_result: "to feed job result back to the session",
11 # XXX: should this be available right off the bat or should we wait
12 # until all of the mandatory jobs have been executed.

Subscribers

People subscribed via source and target branches