BIND 10 trac2254, updated. 96da4b2e1aa8c82b1f33103a89d7bd8be8ca390b [2254] editorial cleanup: removed space in param spec, folded long lines

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Sep 28 05:20:50 UTC 2012


The branch, trac2254 has been updated
       via  96da4b2e1aa8c82b1f33103a89d7bd8be8ca390b (commit)
       via  fa10a89c1e4b03da98f9926f31e1680cf5d4ef5d (commit)
       via  da0b581e22f7a10931767f4d535cfda1554cc525 (commit)
      from  f759086adfb6c899be7a2201f063af49e88f60b7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 96da4b2e1aa8c82b1f33103a89d7bd8be8ca390b
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Thu Sep 27 16:53:01 2012 -0700

    [2254] editorial cleanup: removed space in param spec, folded long lines

commit fa10a89c1e4b03da98f9926f31e1680cf5d4ef5d
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Thu Sep 27 16:06:58 2012 -0700

    [2254] suggested doc extension

commit da0b581e22f7a10931767f4d535cfda1554cc525
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Thu Sep 27 15:08:51 2012 -0700

    [2254] trivial editorial fix

-----------------------------------------------------------------------

Summary of changes:
 src/bin/bindctl/bindcmd.py            |    7 ++++-
 src/bin/bindctl/bindctl_main.py.in    |   49 ++++++++++++++++++++-------------
 src/bin/bindctl/tests/bindctl_test.py |   12 ++++----
 3 files changed, 42 insertions(+), 26 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/bindctl/bindcmd.py b/src/bin/bindctl/bindcmd.py
index 9e7b1e1..5ba8a51 100644
--- a/src/bin/bindctl/bindcmd.py
+++ b/src/bin/bindctl/bindcmd.py
@@ -474,6 +474,10 @@ class BindCmdInterpreter(Cmd):
         """
         Returns True if the given (parsed) command is known and has a
         parameter which points to a config data identifier
+
+        Parameters:
+        cmd (cmdparse.BindCmdParse): command context, including given params
+
         """
         if cmd.module not in self.modules:
             return False
@@ -496,7 +500,8 @@ class BindCmdInterpreter(Cmd):
                     if self._cmd_has_identifier_param(cmd):
                         # For tab-completion of identifiers, replace hardcoded
                         # hints with hints derived from the config data
-                        id_text = self.location + "/" + cur_line.rpartition(" ")[2]
+                        id_text = self.location + "/" +\
+                            cur_line.rpartition(" ")[2]
                         hints = self._get_identifier_startswith(id_text)
 
             except CmdModuleNameFormatError:
diff --git a/src/bin/bindctl/bindctl_main.py.in b/src/bin/bindctl/bindctl_main.py.in
index b6a5b18..1f86ec9 100755
--- a/src/bin/bindctl/bindctl_main.py.in
+++ b/src/bin/bindctl/bindctl_main.py.in
@@ -42,16 +42,19 @@ def prepare_config_commands(tool):
     cmd = CommandInfo(name = "show", desc = "Show configuration.")
     param = ParamInfo(name = "argument", type = "string", optional=True, desc = "If you specify the argument 'all' (before the identifier), recursively show all child elements for the given identifier.")
     cmd.add_param(param)
-    param = ParamInfo(name = IDENTIFIER_PARAM, type = "string", optional=True, desc = DEFAULT_IDENTIFIER_DESC)
+    param = ParamInfo(name=IDENTIFIER_PARAM, type="string", optional=True,
+                      desc=DEFAULT_IDENTIFIER_DESC)
     cmd.add_param(param)
     module.add_command(cmd)
 
-    cmd = CommandInfo(name = "show_json", desc = "Show full configuration in JSON format.")
-    param = ParamInfo(name = IDENTIFIER_PARAM, type = "string", optional=True, desc = DEFAULT_IDENTIFIER_DESC)
+    cmd = CommandInfo(name="show_json",
+                      desc="Show full configuration in JSON format.")
+    param = ParamInfo(name=IDENTIFIER_PARAM, type="string", optional=True,
+                      desc=DEFAULT_IDENTIFIER_DESC)
     cmd.add_param(param)
     module.add_command(cmd)
 
-    cmd = CommandInfo(name = "add", desc =
+    cmd = CommandInfo(name="add", desc=
         "Add an entry to configuration list or a named set. "
         "When adding to a list, the command has one optional argument, "
         "a value to add to the list. The value must be in correct JSON "
@@ -60,45 +63,53 @@ def prepare_config_commands(tool):
         "parameter value, similar to when adding to a list. "
         "In either case, when no value is given, an entry will be "
         "constructed with default values.")
-    param = ParamInfo(name = IDENTIFIER_PARAM, type = "string", optional=True, desc = DEFAULT_IDENTIFIER_DESC)
+    param = ParamInfo(name=IDENTIFIER_PARAM, type="string", optional=True,
+                      desc=DEFAULT_IDENTIFIER_DESC)
     cmd.add_param(param)
-    param = ParamInfo(name = "value_or_name", type = "string", optional=True, desc = "Specifies a value to add to the list, or the name when adding to a named set. It must be in correct JSON format and complete.")
+    param = ParamInfo(name="value_or_name", type="string", optional=True,
+                      desc="Specifies a value to add to the list, or the name when adding to a named set. It must be in correct JSON format and complete.")
     cmd.add_param(param)
     module.add_command(cmd)
-    param = ParamInfo(name = "value_for_set", type = "string", optional=True, desc = "Specifies an optional value to add to the named map. It must be in correct JSON format and complete.")
+    param = ParamInfo(name="value_for_set", type="string", optional=True,
+                      desc="Specifies an optional value to add to the named map. It must be in correct JSON format and complete.")
     cmd.add_param(param)
     module.add_command(cmd)
 
-    cmd = CommandInfo(name = "remove", desc = "Remove entry from configuration list or named set.")
-    param = ParamInfo(name = IDENTIFIER_PARAM, type = "string", optional=True, desc = DEFAULT_IDENTIFIER_DESC)
+    cmd = CommandInfo(name="remove", desc="Remove entry from configuration list or named set.")
+    param = ParamInfo(name=IDENTIFIER_PARAM, type="string", optional=True,
+                      desc=DEFAULT_IDENTIFIER_DESC)
     cmd.add_param(param)
     param = ParamInfo(name = "value", type = "string", optional=True, desc = "When identifier is a list, specifies a value to remove from the list. It must be in correct JSON format and complete. When it is a named set, specifies the name to remove.")
     cmd.add_param(param)
     module.add_command(cmd)
 
-    cmd = CommandInfo(name = "set", desc = "Set a configuration value.")
-    param = ParamInfo(name = IDENTIFIER_PARAM, type = "string", optional=True, desc = DEFAULT_IDENTIFIER_DESC)
+    cmd = CommandInfo(name="set", desc="Set a configuration value.")
+    param = ParamInfo(name=IDENTIFIER_PARAM, type="string", optional=True,
+                      desc=DEFAULT_IDENTIFIER_DESC)
     cmd.add_param(param)
-    param = ParamInfo(name = "value", type = "string", optional=False, desc = "Specifies a value to set. It must be in correct JSON format and complete.")
+    param = ParamInfo(name="value", type="string", optional=False,
+                      desc="Specifies a value to set. It must be in correct JSON format and complete.")
     cmd.add_param(param)
     module.add_command(cmd)
 
-    cmd = CommandInfo(name = "unset", desc = "Unset a configuration value (i.e. revert to the default, if any).")
-    param = ParamInfo(name = IDENTIFIER_PARAM, type = "string", optional=False, desc = DEFAULT_IDENTIFIER_DESC)
+    cmd = CommandInfo(name="unset", desc="Unset a configuration value (i.e. revert to the default, if any).")
+    param = ParamInfo(name=IDENTIFIER_PARAM, type="string", optional=False,
+                      desc=DEFAULT_IDENTIFIER_DESC)
     cmd.add_param(param)
     module.add_command(cmd)
 
-    cmd = CommandInfo(name = "diff", desc = "Show all local changes that have not been committed.")
+    cmd = CommandInfo(name="diff", desc="Show all local changes that have not been committed.")
     module.add_command(cmd)
 
-    cmd = CommandInfo(name = "revert", desc = "Revert all local changes.")
+    cmd = CommandInfo(name="revert", desc="Revert all local changes.")
     module.add_command(cmd)
 
-    cmd = CommandInfo(name = "commit", desc = "Commit all local changes.")
+    cmd = CommandInfo(name="commit", desc="Commit all local changes.")
     module.add_command(cmd)
 
-    cmd = CommandInfo(name = "go", desc = "Go to a specific configuration part.")
-    param = ParamInfo(name = IDENTIFIER_PARAM, type="string", optional=False, desc = DEFAULT_IDENTIFIER_DESC)
+    cmd = CommandInfo(name="go", desc="Go to a specific configuration part.")
+    param = ParamInfo(name=IDENTIFIER_PARAM, type="string", optional=False,
+                      desc=DEFAULT_IDENTIFIER_DESC)
     cmd.add_param(param)
     module.add_command(cmd)
 
diff --git a/src/bin/bindctl/tests/bindctl_test.py b/src/bin/bindctl/tests/bindctl_test.py
index 3364211..1b2aae6 100644
--- a/src/bin/bindctl/tests/bindctl_test.py
+++ b/src/bin/bindctl/tests/bindctl_test.py
@@ -420,15 +420,15 @@ class TestConfigCommands(unittest.TestCase):
         sys.stdout = self.stdout_backup
 
     def test_cmd_has_identifier_param(self):
-        module = ModuleInfo(name = "test_module")
+        module = ModuleInfo(name="test_module")
 
-        cmd = CommandInfo(name = "command_with_identifier")
-        param = ParamInfo(name = bindcmd.IDENTIFIER_PARAM)
+        cmd = CommandInfo(name="command_with_identifier")
+        param = ParamInfo(name=bindcmd.IDENTIFIER_PARAM)
         cmd.add_param(param)
         module.add_command(cmd)
 
-        cmd = CommandInfo(name = "command_without_identifier")
-        param = ParamInfo(name = "some_argument")
+        cmd = CommandInfo(name="command_without_identifier")
+        param = ParamInfo(name="some_argument")
         cmd.add_param(param)
         module.add_command(cmd)
 
@@ -445,7 +445,7 @@ class TestConfigCommands(unittest.TestCase):
 
     def test_get_identifier_startswith(self):
         hints = self.tool._get_identifier_startswith("/")
-        self.assertEqual([ 'foo/an_int', 'foo/a_list'], hints)
+        self.assertEqual(['foo/an_int', 'foo/a_list'], hints)
 
         hints = self.tool._get_identifier_startswith("/foo/an")
         self.assertEqual(['foo/an_int'], hints)



More information about the bind10-changes mailing list