From f87355fddc2a931e3f984d074a713f4313d5f709 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 11 Jul 2009 07:46:22 -0400 Subject: Adjustments to new versioned_property behavior. Also adjusted libbe/comment.py to move to user-specified alt_ids, rather than uuids. --- becommands/set.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'becommands/set.py') diff --git a/becommands/set.py b/becommands/set.py index e771018..939236a 100644 --- a/becommands/set.py +++ b/becommands/set.py @@ -26,7 +26,7 @@ def _value_string(bd, setting): val = bd.settings.get(setting, settings_object.EMPTY) if val == settings_object.EMPTY: default = getattr(bd, bd._setting_name_to_attr_name(setting)) - if default != settings_object.EMPTY: + if default not in [None, settings_object.EMPTY]: val = "None (%s)" % default else: val = None -- cgit From a03fea1b2b2eeb95d8ab62c49724bbf0cf631f19 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 11 Jul 2009 08:13:34 -0400 Subject: Removed from copyright blurbs. These didn't work with my update_copyright.sh. I went with Aaron Bentley and Panometrics, Inc. instead of Aaron Bentley and Panometrics, Inc. just because of line length, but I'm open to convincing if people prefer the latter... --- becommands/set.py | 1 - 1 file changed, 1 deletion(-) (limited to 'becommands/set.py') diff --git a/becommands/set.py b/becommands/set.py index 939236a..a7a47cc 100644 --- a/becommands/set.py +++ b/becommands/set.py @@ -3,7 +3,6 @@ # Marien Zwart # Thomas Gerigk # W. Trevor King -# # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -- cgit From 5208a2808a2a87cbfa9d8589d5ac254aa0dea64f Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 11 Jul 2009 09:46:38 -0400 Subject: Updating "be set --help" and "be status --help". I don't really like the "defaults to None" for the settings that have funky initialization procedures (most of them :p), but I'm not sure how to handle that cleanly yet. Perhaps be set --current I also need to find a method of adding complicated settings like the nested lists for severities, etc from the "be set" commandline. --- becommands/set.py | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) (limited to 'becommands/set.py') diff --git a/becommands/set.py b/becommands/set.py index a7a47cc..b050b35 100644 --- a/becommands/set.py +++ b/becommands/set.py @@ -18,7 +18,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """Change tree settings""" -from libbe import cmdutil, bugdir, settings_object +import textwrap +from libbe import cmdutil, bugdir, rcs, settings_object __desc__ = __doc__ def _value_string(bd, setting): @@ -75,6 +76,30 @@ def get_parser(): parser = cmdutil.CmdOptionParser("be set [NAME] [VALUE]") return parser +def get_bugdir_settings(): + settings = [] + for s in bugdir.BugDir.settings_properties: + settings.append(s) + settings.sort() + documented_settings = [] + for s in settings: + set = getattr(bugdir.BugDir, s) + dstr = set.__doc__.strip() + # per-setting comment adjustments + if s == "rcs_name": + lines = dstr.split('\n') + while lines[0].startswith("This property defaults to") == False: + lines.pop(0) + assert len(lines) != None, \ + "Unexpected rcs_name docstring:\n '%s'" % dstr + lines.insert( + 0, "The name of the revision control system to use.\n") + dstr = '\n'.join(lines) + doc = textwrap.wrap(dstr, width=70, initial_indent=' ', + subsequent_indent=' ') + documented_settings.append("%s\n%s" % (s, '\n'.join(doc))) + return documented_settings + longhelp=""" Show or change per-tree settings. @@ -82,14 +107,11 @@ If name and value are supplied, the name is set to a new value. If no value is specified, the current value is printed. If no arguments are provided, all names and values are listed. -Interesting settings are: -rcs_name - The name of the revision control system. "Arch" and "None" are supported. -target - The current development goal - To unset a setting, set it to "none". -""" + +Allowed settings are: + +%s""" % ('\n'.join(get_bugdir_settings()),) def help(): return get_parser().help_str() + longhelp -- cgit From a65b273fa14df2a085342bac14abb8a2167ff98a Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 11 Jul 2009 10:09:27 -0400 Subject: Went through "closed" bugs looking for miss-categorized bugs. Found a few that were actually "fixed" and one that I reopened. Perhaps we should add a "merged" status to the default, so that the merged bugs don't clutter up the closed bugs category... --- becommands/set.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'becommands/set.py') diff --git a/becommands/set.py b/becommands/set.py index b050b35..fa431e9 100644 --- a/becommands/set.py +++ b/becommands/set.py @@ -60,7 +60,9 @@ def execute(args, test=False): elif len(args) == 1: print _value_string(bd, args[0]) else: - if args[1] != "none": + if args[1] == "none": + del bd.settings[args[0]] + else: if args[0] not in bd.settings_properties: msg = "Invalid setting %s\n" % args[0] msg += 'Allowed settings:\n ' @@ -68,8 +70,6 @@ def execute(args, test=False): raise cmdutil.UserError(msg) old_setting = bd.settings.get(args[0]) setattr(bd, args[0], args[1]) - else: - del bd.settings[args[0]] bd.save() def get_parser(): -- cgit