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

Proposed by Brendan Donegan
Status: Merged
Approved by: Zygmunt Krynicki
Approved revision: 2983
Merged at revision: 2983
Proposed branch: lp:~brendan-donegan/checkbox/bug1314516_cli
Merge into: lp:checkbox
Diff against target: 28 lines (+5/-2)
2 files modified
checkbox-ng/checkbox_ng/commands/cli.py (+1/-1)
plainbox/plainbox/impl/job.py (+4/-1)
To merge this branch: bzr merge lp:~brendan-donegan/checkbox/bug1314516_cli
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Approve
Review via email: mp+218760@code.launchpad.net

Description of the change

Like in checkbox-gui, we want to have the following schema for displaying jobs in the HUI

- Always prefer summary.
- If no summary is available use partial_id, unless the job is local in which case use description.

To post a comment you must log in.
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

The modification to job.py makes me a little bit queasy, but I can't think of a better way.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

+1

I'll try to merge this change with my near-complete rewrite of the CLI.

Thanks
ZK

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox-ng/checkbox_ng/commands/cli.py'
2--- checkbox-ng/checkbox_ng/commands/cli.py 2014-05-02 13:47:35 +0000
3+++ checkbox-ng/checkbox_ng/commands/cli.py 2014-05-08 08:58:36 +0000
4@@ -136,7 +136,7 @@
5 prefix = '[ ]'
6 if self.job_selection[job]:
7 prefix = '[X]'
8- title = job.partial_id
9+ title = job.summary
10 line = prefix + self.depth * ' ' + ' ' + title
11 if len(line) > cols:
12 col_max = cols - 4 # includes len('...') + a space
13
14=== modified file 'plainbox/plainbox/impl/job.py'
15--- plainbox/plainbox/impl/job.py 2014-05-07 12:59:01 +0000
16+++ plainbox/plainbox/impl/job.py 2014-05-08 08:58:36 +0000
17@@ -703,7 +703,10 @@
18 if legacy_mode: # using local jobs
19 for job in [j for j in job_list if j.via == link]:
20 if job.plugin == 'local':
21- category = cls(job.description)
22+ if job.summary == job.partial_id:
23+ category = cls(job.description)
24+ else:
25+ category = cls(job.summary)
26 cls.create_tree(job_list, category, job.checksum,
27 legacy_mode)
28 node.add_category(category)

Subscribers

People subscribed via source and target branches