Added comment support to show, added comment command
authorAaron Bentley <abentley@panoramicfeedback.com>
Wed, 23 Mar 2005 17:34:55 +0000 (17:34 +0000)
committerAaron Bentley <abentley@panoramicfeedback.com>
Wed, 23 Mar 2005 17:34:55 +0000 (17:34 +0000)
.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/values
becommands/comment.py [new file with mode: 0644]
becommands/show.py
libbe/bugdir.py

index 87b202b119bd900d2841e0e3c0c394c56d79f900..625495f4264d1492f40aaac57042ce2576a0f1ab 100644 (file)
@@ -15,7 +15,7 @@ severity=serious
 
 
 
-status=open
+status=closed
 
 
 
diff --git a/becommands/comment.py b/becommands/comment.py
new file mode 100644 (file)
index 0000000..f162969
--- /dev/null
@@ -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
index 3ec5ec46ba30460db883c9951593955ea344d060..77a0875583f078a80565b56771fdd1cb9f3d33d7 100644 (file)
@@ -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
index 25a0b66926294cd349bae06b06df9d5261f0be5d..e47c1094d117e97f0be99332a2f6f9c0134bbe3d 100644 (file)
@@ -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