Browse Source

Remove Ctrl-M from end of lines.

git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1417 e5f2f494-b856-4b98-b285-d166d9295462
Jeremy C. Reed 15 years ago
parent
commit
ea40d6ddb1
2 changed files with 233 additions and 233 deletions
  1. 114 114
      src/bin/bindctl/bindctl-source.py.in
  2. 119 119
      src/bin/bindctl/exception.py

+ 114 - 114
src/bin/bindctl/bindctl-source.py.in

@@ -1,117 +1,117 @@
 #!@PYTHON@
 
-# Copyright (C) 2009  Internet Systems Consortium.
-#
-# Permission to use, copy, modify, and distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
-# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
-# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-
+# Copyright (C) 2009  Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
+# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
 import sys; sys.path.append ('@@PYTHONPATH@@')
-
-from bindctl.moduleinfo import *
-from bindctl.bindcmd import *
-import pprint
-from optparse import OptionParser, OptionValueError
-
-__version__ = 'Bindctl'
-
-def prepare_config_commands(tool):
-    module = ModuleInfo(name = "config", desc = "Configuration commands")
-    cmd = CommandInfo(name = "show", desc = "Show configuration")
-    param = ParamInfo(name = "identifier", type = "string", optional=True)
-    cmd.add_param(param)
-    module.add_command(cmd)
-
-    cmd = CommandInfo(name = "add", desc = "Add entry to configuration list")
-    param = ParamInfo(name = "identifier", type = "string", optional=True)
-    cmd.add_param(param)
-    param = ParamInfo(name = "value", type = "string", optional=False)
-    cmd.add_param(param)
-    module.add_command(cmd)
-
-    cmd = CommandInfo(name = "remove", desc = "Remove entry from configuration list")
-    param = ParamInfo(name = "identifier", type = "string", optional=True)
-    cmd.add_param(param)
-    param = ParamInfo(name = "value", type = "string", optional=False)
-    cmd.add_param(param)
-    module.add_command(cmd)
-
-    cmd = CommandInfo(name = "set", desc = "Set a configuration value")
-    param = ParamInfo(name = "identifier", type = "string", optional=True)
-    cmd.add_param(param)
-    param = ParamInfo(name = "value", type = "string", optional=False)
-    cmd.add_param(param)
-    module.add_command(cmd)
-
-    cmd = CommandInfo(name = "unset", desc = "Unset a configuration value")
-    param = ParamInfo(name = "identifier", type = "string", optional=False)
-    cmd.add_param(param)
-    module.add_command(cmd)
-
-    cmd = CommandInfo(name = "diff", desc = "Show all local changes")
-    module.add_command(cmd)
-
-    cmd = CommandInfo(name = "revert", desc = "Revert all local changes")
-    module.add_command(cmd)
-
-    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", type="string", optional=False)
-    cmd.add_param(param)
-    module.add_command(cmd)
-
-    tool.add_module_info(module)
-
-def check_port(option, opt_str, value, parser):
-    if (value < 0) or (value > 65535):
-        raise OptionValueError('%s requires a port number (0-65535)' % opt_str)
-    parser.values.port = value
-
-def check_addr(option, opt_str, value, parser):
-    ipstr = value
-    ip_family = socket.AF_INET
-    if (ipstr.find(':') != -1):
-        ip_family = socket.AF_INET6
-
-    try:
-        socket.inet_pton(ip_family, ipstr)
-    except:
-        raise OptionValueError("%s invalid ip address" % ipstr)
-
-    parser.values.addr = value
-
-def set_bindctl_options(parser):
-    parser.add_option('-p', '--port', dest = 'port', type = 'int',
-            action = 'callback', callback=check_port,
-            default = '8080', help = 'port for cmdctl of bind10')
-
-    parser.add_option('-a', '--address', dest = 'addr', type = 'string',
-            action = 'callback', callback=check_addr,
-            default = '127.0.0.1', help = 'IP address for cmdctl of bind10')
-
-
-if __name__ == '__main__':
-    try:
-        parser = OptionParser(version = __version__)
-        set_bindctl_options(parser)
-        (options, args) = parser.parse_args()
-        server_addr = options.addr + ':' + str(options.port)
-        tool = BindCmdInterpreter(server_addr)
-        prepare_config_commands(tool)
-        tool.run()
-    except Exception as e:
-        print(e, "\nFailed to connect with b10-cmdctl module, is it running?")
-
-
+
+from bindctl.moduleinfo import *
+from bindctl.bindcmd import *
+import pprint
+from optparse import OptionParser, OptionValueError
+
+__version__ = 'Bindctl'
+
+def prepare_config_commands(tool):
+    module = ModuleInfo(name = "config", desc = "Configuration commands")
+    cmd = CommandInfo(name = "show", desc = "Show configuration")
+    param = ParamInfo(name = "identifier", type = "string", optional=True)
+    cmd.add_param(param)
+    module.add_command(cmd)
+
+    cmd = CommandInfo(name = "add", desc = "Add entry to configuration list")
+    param = ParamInfo(name = "identifier", type = "string", optional=True)
+    cmd.add_param(param)
+    param = ParamInfo(name = "value", type = "string", optional=False)
+    cmd.add_param(param)
+    module.add_command(cmd)
+
+    cmd = CommandInfo(name = "remove", desc = "Remove entry from configuration list")
+    param = ParamInfo(name = "identifier", type = "string", optional=True)
+    cmd.add_param(param)
+    param = ParamInfo(name = "value", type = "string", optional=False)
+    cmd.add_param(param)
+    module.add_command(cmd)
+
+    cmd = CommandInfo(name = "set", desc = "Set a configuration value")
+    param = ParamInfo(name = "identifier", type = "string", optional=True)
+    cmd.add_param(param)
+    param = ParamInfo(name = "value", type = "string", optional=False)
+    cmd.add_param(param)
+    module.add_command(cmd)
+
+    cmd = CommandInfo(name = "unset", desc = "Unset a configuration value")
+    param = ParamInfo(name = "identifier", type = "string", optional=False)
+    cmd.add_param(param)
+    module.add_command(cmd)
+
+    cmd = CommandInfo(name = "diff", desc = "Show all local changes")
+    module.add_command(cmd)
+
+    cmd = CommandInfo(name = "revert", desc = "Revert all local changes")
+    module.add_command(cmd)
+
+    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", type="string", optional=False)
+    cmd.add_param(param)
+    module.add_command(cmd)
+
+    tool.add_module_info(module)
+
+def check_port(option, opt_str, value, parser):
+    if (value < 0) or (value > 65535):
+        raise OptionValueError('%s requires a port number (0-65535)' % opt_str)
+    parser.values.port = value
+
+def check_addr(option, opt_str, value, parser):
+    ipstr = value
+    ip_family = socket.AF_INET
+    if (ipstr.find(':') != -1):
+        ip_family = socket.AF_INET6
+
+    try:
+        socket.inet_pton(ip_family, ipstr)
+    except:
+        raise OptionValueError("%s invalid ip address" % ipstr)
+
+    parser.values.addr = value
+
+def set_bindctl_options(parser):
+    parser.add_option('-p', '--port', dest = 'port', type = 'int',
+            action = 'callback', callback=check_port,
+            default = '8080', help = 'port for cmdctl of bind10')
+
+    parser.add_option('-a', '--address', dest = 'addr', type = 'string',
+            action = 'callback', callback=check_addr,
+            default = '127.0.0.1', help = 'IP address for cmdctl of bind10')
+
+
+if __name__ == '__main__':
+    try:
+        parser = OptionParser(version = __version__)
+        set_bindctl_options(parser)
+        (options, args) = parser.parse_args()
+        server_addr = options.addr + ':' + str(options.port)
+        tool = BindCmdInterpreter(server_addr)
+        prepare_config_commands(tool)
+        tool.run()
+    except Exception as e:
+        print(e, "\nFailed to connect with b10-cmdctl module, is it running?")
+
+

+ 119 - 119
src/bin/bindctl/exception.py

@@ -1,119 +1,119 @@
-# Copyright (C) 2009  Internet Systems Consortium.
-#
-# Permission to use, copy, modify, and distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
-# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
-# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-
-class BindCtlException(Exception):
-    """Abstract base class shared by all bindctl exceptions"""
-    def __str__(self):
-        return "Big tool has problem"
-
-# Begin define Format exception
-
-class CmdFormatError(BindCtlException):
-    """Command is malformed"""
-    def __str__(self):
-        return "Command is malformed"
-
-        
-class CmdModuleNameFormatError(CmdFormatError):
-    """module name format error"""
-
-    def __str__(self):
-        return "Module name format error: the charater of name can only be '0-9a-zA-Z_'" 
-                      
-                
-class CmdCommandNameFormatError(CmdFormatError):
-    """command name format error"""
-    
-    def __init__(self, module):
-        self.module = module        
-        
-    def __str__(self):
-        return "Command name format error: the charater of name can only be '0-9a-zA-Z_'"      
-        
-        
-class CmdMissCommandNameFormatError(CmdFormatError):
-    """Module name isn't finished"""
-    
-    def __init__(self, module):
-        self.module = module
-        
-    def __str__(self):
-        return "command name is missed"   
-
-
-class CmdParamFormatError(CmdFormatError):
-    """Command is malformed which parameter isn't key value pair"""
-    
-    def __init__(self, module, command):        
-        self.module = module
-        self.command = command        
-
-    def __str__(self):
-        return  "Parameter format error, it should like 'key = value'"         
-        
-# Begin define the exception for syntax
-
-class CmdSyntaxError(BindCtlException):
-    """Command line has syntax error"""
-    
-    def __str__(self):
-        return "Command line has syntax error"
-
-
-class CmdUnknownModuleSyntaxError(CmdSyntaxError):
-    """Command is unknown"""
-    def __init__(self, module):
-        self.module = module
-
-    def __str__(self):
-        return str("Unknown module '%s'" % self.module)
-        
-
-class CmdUnknownCmdSyntaxError(CmdSyntaxError):
-    """Command is unknown"""
-    def __init__(self, module, command):
-        self.module = module
-        self.command = command
-
-    def __str__(self):
-        return str("Unknown command '%s' to module '%s'" % 
-                    (self.command, self.module))
-                    
-
-class CmdUnknownParamSyntaxError(CmdSyntaxError):
-    """The parameter of command is unknown"""
-    def __init__(self, module, command, param):
-        self.module = module
-        self.command = command
-        self.param = param
-
-    def __str__(self):
-        return str("Unknown parameter '%s' to command '%s' of module '%s'" %
-                   (self.param, self.command, self.module))
-                   
-
-class CmdMissParamSyntaxError(CmdSyntaxError):
-    """The parameter of one command is missed"""
-    def __init__(self, module, command, param):
-        self.module = module
-        self.command = command
-        self.param = param
-
-    def __str__(self):
-        return str("Parameter '%s' is missed for command '%s' of module '%s'" % 
-                   (self.param, self.command, self.module))
-                   
-   
+# Copyright (C) 2009  Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
+# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+class BindCtlException(Exception):
+    """Abstract base class shared by all bindctl exceptions"""
+    def __str__(self):
+        return "Big tool has problem"
+
+# Begin define Format exception
+
+class CmdFormatError(BindCtlException):
+    """Command is malformed"""
+    def __str__(self):
+        return "Command is malformed"
+
+        
+class CmdModuleNameFormatError(CmdFormatError):
+    """module name format error"""
+
+    def __str__(self):
+        return "Module name format error: the charater of name can only be '0-9a-zA-Z_'" 
+                      
+                
+class CmdCommandNameFormatError(CmdFormatError):
+    """command name format error"""
+    
+    def __init__(self, module):
+        self.module = module        
+        
+    def __str__(self):
+        return "Command name format error: the charater of name can only be '0-9a-zA-Z_'"      
+        
+        
+class CmdMissCommandNameFormatError(CmdFormatError):
+    """Module name isn't finished"""
+    
+    def __init__(self, module):
+        self.module = module
+        
+    def __str__(self):
+        return "command name is missed"   
+
+
+class CmdParamFormatError(CmdFormatError):
+    """Command is malformed which parameter isn't key value pair"""
+    
+    def __init__(self, module, command):        
+        self.module = module
+        self.command = command        
+
+    def __str__(self):
+        return  "Parameter format error, it should like 'key = value'"         
+        
+# Begin define the exception for syntax
+
+class CmdSyntaxError(BindCtlException):
+    """Command line has syntax error"""
+    
+    def __str__(self):
+        return "Command line has syntax error"
+
+
+class CmdUnknownModuleSyntaxError(CmdSyntaxError):
+    """Command is unknown"""
+    def __init__(self, module):
+        self.module = module
+
+    def __str__(self):
+        return str("Unknown module '%s'" % self.module)
+        
+
+class CmdUnknownCmdSyntaxError(CmdSyntaxError):
+    """Command is unknown"""
+    def __init__(self, module, command):
+        self.module = module
+        self.command = command
+
+    def __str__(self):
+        return str("Unknown command '%s' to module '%s'" % 
+                    (self.command, self.module))
+                    
+
+class CmdUnknownParamSyntaxError(CmdSyntaxError):
+    """The parameter of command is unknown"""
+    def __init__(self, module, command, param):
+        self.module = module
+        self.command = command
+        self.param = param
+
+    def __str__(self):
+        return str("Unknown parameter '%s' to command '%s' of module '%s'" %
+                   (self.param, self.command, self.module))
+                   
+
+class CmdMissParamSyntaxError(CmdSyntaxError):
+    """The parameter of one command is missed"""
+    def __init__(self, module, command, param):
+        self.module = module
+        self.command = command
+        self.param = param
+
+    def __str__(self):
+        return str("Parameter '%s' is missed for command '%s' of module '%s'" % 
+                   (self.param, self.command, self.module))
+                   
+