diff options
author | W. Trevor King <wking@drexel.edu> | 2008-11-15 18:48:08 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2008-11-15 18:48:08 -0500 |
commit | 3c34141a7b7f91f599c9e254b864e21847934505 (patch) | |
tree | 031d078c13aa8d4dc99a40f8df89602dcf253ab4 /libbe | |
parent | 03011f286420d8e091052019ee41eba021041e61 (diff) | |
download | bugseverywhere-3c34141a7b7f91f599c9e254b864e21847934505.tar.gz |
Fixed some errors produced while moving bug_summary to Bug.string().
Diffstat (limited to 'libbe')
-rw-r--r-- | libbe/bug.py | 32 |
1 files 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): |