diff options
author | W. Trevor King <wking@drexel.edu> | 2008-11-15 16:17:05 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2008-11-15 16:17:05 -0500 |
commit | 2a800d09623720fc0a0c745611d627faec20a9ca (patch) | |
tree | 1bb26cb2b2a6cac2347073c1bff90b5adfa598d4 /libbe/cmdutil.py | |
parent | a6861cc61a662872783f2359019e72869636441d (diff) | |
download | bugseverywhere-2a800d09623720fc0a0c745611d627faec20a9ca.tar.gz |
becommands/show.py gives more specific bug information.
Diffstat (limited to 'libbe/cmdutil.py')
-rw-r--r-- | libbe/cmdutil.py | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/libbe/cmdutil.py b/libbe/cmdutil.py index 6fb915a..69cfe84 100644 --- a/libbe/cmdutil.py +++ b/libbe/cmdutil.py @@ -73,21 +73,27 @@ def get_bug(spec, bug_dir=None): return matches[0] def bug_summary(bug, bugs, no_target=False, shortlist=False): - target = bug.target - if target is None or no_target: - target = "" - else: - target = " Target: %s" % target - if bug.assigned is None: - assigned = "" - else: - assigned = " Assigned: %s" % bug.assigned + info = [("ID", bug.uuid), + ("Short name", unique_name(bug, bugs)), + ("Severity", bug.severity), + ("Status", bug.status), + ("Assigned", bug.assigned), + ("Target", bug.target), + ("Creator", bug.creator), + ("Created", "%s (%s)" % (utility.handy_time(bug.time),utility.time_to_str(bug.time)))] + newinfo = [] + for k,v in info: + if v == None: + newinfo.append((k,"")) + else: + newinfo.append((k,v)) + info = newinfo if shortlist == False: - return " ID: %s\n Severity: %s\n%s%s\n Creator: %s \n%s\n" % \ - (unique_name(bug, bugs), bug.severity, assigned, target, - bug.creator, bug.summary) + longest_key_len = max([len(k) for k,v in info]) + infolines = [" %*s : %s\n" % (longest_key_len,k,v) for k,v in info] + return "".join(infolines) + "%s\n" % bug.summary else: - return "%4s: %s\n" % (unique_name(bug, bugs), bug.summary) + return "%s: %s\n" % (unique_name(bug, bugs), bug.summary) def iter_commands(): for name, module in plugin.iter_plugins("becommands"): |