[svn] commit: r1444 - in /trunk/src/bin/bindctl: bindcmd.py moduleinfo.py
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Mar 16 12:59:38 UTC 2010
Author: jelte
Date: Tue Mar 16 12:59:38 2010
New Revision: 1444
Log:
fixed indentation for those strings
Modified:
trunk/src/bin/bindctl/bindcmd.py
trunk/src/bin/bindctl/moduleinfo.py
Modified: trunk/src/bin/bindctl/bindcmd.py
==============================================================================
--- trunk/src/bin/bindctl/bindcmd.py (original)
+++ trunk/src/bin/bindctl/bindcmd.py Tue Mar 16 12:59:38 2010
@@ -342,6 +342,7 @@
if cmd.module == "config":
# grm text has been stripped of slashes...
my_text = self.location + "/" + cur_line.rpartition(" ")[2]
+ print("[XX] completing config part")
list = self.config_data.get_config_item_list(my_text.rpartition("/")[0])
hints.extend([val for val in list if val.startswith(text)])
except CmdModuleNameFormatError:
Modified: trunk/src/bin/bindctl/moduleinfo.py
==============================================================================
--- trunk/src/bin/bindctl/moduleinfo.py (original)
+++ trunk/src/bin/bindctl/moduleinfo.py Tue Mar 16 12:59:38 2010
@@ -67,47 +67,47 @@
def add_param(self, paraminfo):
- """Add a ParamInfo object to this CommandInfo"""
+ """Add a ParamInfo object to this CommandInfo"""
self.params[paraminfo.name] = paraminfo
def has_param_with_name(self, param_name):
- """Returns true if the parameter with param_name exists"""
+ """Returns true if the parameter with param_name exists"""
return param_name in self.params
def get_param_with_name(self, param_name):
- """Returns the ParamInfo with the given name. Raises a
- KeyError if it doesn't exist"""
+ """Returns the ParamInfo with the given name. Raises a
+ KeyError if it doesn't exist"""
return self.params[param_name]
def get_params(self):
- """Returns a list of all ParamInfo objects for this CommandInfo"""
+ """Returns a list of all ParamInfo objects for this CommandInfo"""
return list(self.params.values())
def get_param_names(self):
- """Returns a list of the names of all parameters for this command"""
+ """Returns a list of the names of all parameters for this command"""
return list(self.params.keys())
def get_mandatory_param_names(self):
- """Returns a list of the names of all mandatory parameters for
- this command"""
+ """Returns a list of the names of all mandatory parameters for
+ this command"""
all_names = self.params.keys()
return [name for name in all_names
if not self.params[name].is_optional]
def get_param_name_by_position(self, pos, param_count):
- '''
+ """
Find a proper parameter name for the position 'pos':
If param_count is equal to the count of mandatory parameters of command,
and there is some optional parameter, find the first mandatory parameter
from the position 'pos' to the end. Else, return the name on position pos.
(This function will be changed if bindctl command line syntax is changed
in the future. )
- '''
+ """
if type(pos) != int:
raise KeyError(str(pos) + " is not an integer")
@@ -132,7 +132,7 @@
def command_help(self):
- """Prints the help info for this command to stdout"""
+ """Prints the help info for this command to stdout"""
print("Command ", self)
print("\t\thelp (Get help for command)")
@@ -174,34 +174,34 @@
return str("%s \t%s" % (self.name, self.desc))
def add_command(self, command_info):
- """Add a CommandInfo to this ModuleInfo."""
+ """Add a CommandInfo to this ModuleInfo."""
self.commands[command_info.name] = command_info
def has_command_with_name(self, command_name):
- """Returns true if this module has a command with the given name."""
+ """Returns true if this module has a command with the given name."""
return command_name in self.commands
def get_command_with_name(self, command_name):
- """Returns the CommandInfo for the command with the given name.
- Raises a KeyError if not found"""
+ """Returns the CommandInfo for the command with the given name.
+ Raises a KeyError if not found"""
return self.commands[command_name]
def get_commands(self):
- """Returns a list of all CommandInfo objects for this module."""
+ """Returns a list of all CommandInfo objects for this module."""
return list(self.commands.values())
def get_command_names(self):
- """Returns a list of the names of all commands for this module."""
+ """Returns a list of the names of all commands for this module."""
return list(self.commands.keys())
def module_help(self):
- """Prints the help info for this module to stdout"""
+ """Prints the help info for this module to stdout"""
print("Module ", self, "\nAvailable commands:")
for k in self.commands.keys():
print("\t", self.commands[k])
def command_help(self, command):
- """Prints the help info for the command with the given name.
- Raises KeyError if not found"""
+ """Prints the help info for the command with the given name.
+ Raises KeyError if not found"""
self.commands[command].command_help()
More information about the bind10-changes
mailing list