From 6fc191d83c62ec44184b113193e6046bb4999ece Mon Sep 17 00:00:00 2001 From: Aaron Bentley Date: Wed, 23 Mar 2005 17:34:55 +0000 Subject: Added comment support to show, added comment command --- becommands/comment.py | 22 ++++++++++++++++++++++ becommands/show.py | 5 +++++ 2 files changed, 27 insertions(+) create mode 100644 becommands/comment.py (limited to 'becommands') 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 -- cgit