From 57a55f2e33a54b81ab48af6ca8e82bb4dabc2265 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 2 Dec 2008 19:23:04 -0500 Subject: [PATCH] Added support for bug reporter field. Closes e2f6514c-5f9f-4734-a537-daf3fbe7e9a0 --- .be/bugs/e2f6514c-5f9f-4734-a537-daf3fbe7e9a0/values | 2 +- becommands/new.py | 6 ++++++ libbe/bug.py | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.be/bugs/e2f6514c-5f9f-4734-a537-daf3fbe7e9a0/values b/.be/bugs/e2f6514c-5f9f-4734-a537-daf3fbe7e9a0/values index ac013c5..608b460 100644 --- a/.be/bugs/e2f6514c-5f9f-4734-a537-daf3fbe7e9a0/values +++ b/.be/bugs/e2f6514c-5f9f-4734-a537-daf3fbe7e9a0/values @@ -15,7 +15,7 @@ severity=minor -status=open +status=fixed diff --git a/becommands/new.py b/becommands/new.py index 69ff5b8..dec40cb 100644 --- a/becommands/new.py +++ b/becommands/new.py @@ -45,11 +45,17 @@ def execute(args, test=False): raise cmdutil.UsageError("Please supply a summary message") bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test) bug = bd.new_bug(summary=args[0]) + if options.reporter != None: + bug.reporter = options.reporter + else: + bug.reporter = bug.creator bd.save() print "Created bug with ID %s" % bd.bug_shortname(bug) def get_parser(): parser = cmdutil.CmdOptionParser("be new SUMMARY") + parser.add_option("-r", "--reporter", metavar="REPORTER", dest="reporter", + help="The user who reported the bug", default=None) return parser longhelp=""" diff --git a/libbe/bug.py b/libbe/bug.py index cba06d6..14f3db0 100644 --- a/libbe/bug.py +++ b/libbe/bug.py @@ -227,6 +227,7 @@ class Bug(settings_object.SavedSettingsObject): ("Status", self.status), ("Assigned", self._setting_attr_string("assigned")), ("Target", self._setting_attr_string("target")), + ("Reporter", self._setting_attr_string("reporter")), ("Creator", self._setting_attr_string("creator")), ("Created", timestring)] longest_key_len = max([len(k) for k,v in info]) -- 2.26.2