From 3c34141a7b7f91f599c9e254b864e21847934505 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 15 Nov 2008 18:48:08 -0500 Subject: [PATCH] Fixed some errors produced while moving bug_summary to Bug.string(). --- libbe/bug.py | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/libbe/bug.py b/libbe/bug.py index 02c0d7a..430a333 100644 --- a/libbe/bug.py +++ b/libbe/bug.py @@ -18,6 +18,7 @@ import os import os.path import errno import names +import cmdutil import mapfile import time import utility @@ -113,18 +114,19 @@ class Bug(object): return "Bug(uuid=%r)" % self.uuid def string(self, bugs=None, shortlist=False): + if bugs == None: + bugs = list(self.bugdir.list()) + short_name = cmdutil.unique_name(self, bugs) if shortlist == False: - if bugs == None: - bugs = list(self.bugdir.list()) - htime = utility.handy_time(bug.time) - ftime = utility.time_to_str(bug.time) - 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), + htime = utility.handy_time(self.time) + ftime = utility.time_to_str(self.time) + info = [("ID", self.uuid), + ("Short name", short_name), + ("Severity", self.severity), + ("Status", self.status), + ("Assigned", self.assigned), + ("Target", self.target), + ("Creator", self.creator), ("Created", "%s (%s)" % (htime, ftime))] newinfo = [] for k,v in info: @@ -135,12 +137,12 @@ class Bug(object): info = newinfo 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 + return "".join(infolines) + "%s\n" % self.summary else: - statuschar = bug.status[0] - severitychar = bug.severity[0] + statuschar = self.status[0] + severitychar = self.severity[0] chars = "%c%c" % (statuschar, severitychar) - return "%s:%s: %s\n" % (cmdutil.unique_name(bug, bugs), chars, bug.summary) + return "%s:%s: %s\n" % (short_name, chars, self.summary) def __str__(self): return self.string(shortlist=True) def get_path(self, file): -- 2.26.2