aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Bentley <abentley@panoramicfeedback.com>2005-03-23 17:34:55 +0000
committerAaron Bentley <abentley@panoramicfeedback.com>2005-03-23 17:34:55 +0000
commit6fc191d83c62ec44184b113193e6046bb4999ece (patch)
tree2cd090408dfbf76a7309a1ab444cb718d89b4b8c
parent6ce163d30fcd765fdd93d57f0df4d1b1ef97c1b9 (diff)
downloadbugseverywhere-6fc191d83c62ec44184b113193e6046bb4999ece.tar.gz
Added comment support to show, added comment command
-rw-r--r--.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/values2
-rw-r--r--becommands/comment.py22
-rw-r--r--becommands/show.py5
-rw-r--r--libbe/bugdir.py2
4 files changed, 29 insertions, 2 deletions
diff --git a/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/values b/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/values
index 87b202b..625495f 100644
--- a/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/values
+++ b/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/values
@@ -15,7 +15,7 @@ severity=serious
-status=open
+status=closed
diff --git a/becommands/comment.py b/becommands/comment.py
new file mode 100644
index 0000000..f162969
--- /dev/null
+++ b/becommands/comment.py
@@ -0,0 +1,22 @@
+"""Add a comment to a bug"""
+from libbe import bugdir, cmdutil, names
+import os
+def execute(args):
+ options, args = get_parser().parse_args(args)
+ if len(args) < 2:
+ raise cmdutil.UsageError()
+ bug = cmdutil.get_bug(args[0])
+ comment = bugdir.new_comment(bug, args[1])
+ comment.save()
+
+
+def get_parser():
+ parser = cmdutil.CmdOptionParser("be comment BUG-ID COMMENT")
+ return parser
+
+longhelp="""
+Add a comment to a bug.
+"""
+
+def help():
+ return get_parser().help_str() + longhelp
diff --git a/becommands/show.py b/becommands/show.py
index 3ec5ec4..77a0875 100644
--- a/becommands/show.py
+++ b/becommands/show.py
@@ -14,3 +14,8 @@ def execute(args):
time_str = "%s (%s)" % (utility.handy_time(bug.time),
utility.time_to_str(bug.time))
print "Created: %s\n" % time_str
+ for comment in bug.list_comments():
+ print "---------------------------"
+ print "From: %s" % comment.From
+ print "Date: %s\n" % utility.time_to_str(comment.date)
+ print comment.body
diff --git a/libbe/bugdir.py b/libbe/bugdir.py
index 25a0b66..e47c109 100644
--- a/libbe/bugdir.py
+++ b/libbe/bugdir.py
@@ -215,7 +215,7 @@ class Bug(object):
if (uuid.startswith('.')):
continue
yield uuid
- except IOError, e:
+ except OSError, e:
if e.errno != errno.ENOENT:
raise
return