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
=== modified file 'checkbox-ng/checkbox_ng/commands/cli.py'
--- checkbox-ng/checkbox_ng/commands/cli.py 2014-05-02 13:47:35 +0000
+++ checkbox-ng/checkbox_ng/commands/cli.py 2014-05-08 08:58:36 +0000
@@ -136,7 +136,7 @@
136 prefix = '[ ]'136 prefix = '[ ]'
137 if self.job_selection[job]:137 if self.job_selection[job]:
138 prefix = '[X]'138 prefix = '[X]'
139 title = job.partial_id139 title = job.summary
140 line = prefix + self.depth * ' ' + ' ' + title140 line = prefix + self.depth * ' ' + ' ' + title
141 if len(line) > cols:141 if len(line) > cols:
142 col_max = cols - 4 # includes len('...') + a space142 col_max = cols - 4 # includes len('...') + a space
143143
=== modified file 'plainbox/plainbox/impl/job.py'
--- plainbox/plainbox/impl/job.py 2014-05-07 12:59:01 +0000
+++ plainbox/plainbox/impl/job.py 2014-05-08 08:58:36 +0000
@@ -703,7 +703,10 @@
703 if legacy_mode: # using local jobs703 if legacy_mode: # using local jobs
704 for job in [j for j in job_list if j.via == link]:704 for job in [j for j in job_list if j.via == link]:
705 if job.plugin == 'local':705 if job.plugin == 'local':
706 category = cls(job.description)706 if job.summary == job.partial_id:
707 category = cls(job.description)
708 else:
709 category = cls(job.summary)
707 cls.create_tree(job_list, category, job.checksum,710 cls.create_tree(job_list, category, job.checksum,
708 legacy_mode)711 legacy_mode)
709 node.add_category(category)712 node.add_category(category)

Subscribers

People subscribed via source and target branches