From be1347a2b95d775f9f2a8d37a486894644a2e967 Mon Sep 17 00:00:00 2001 From: Daniel Dayley Date: Tue, 2 Nov 2021 21:56:45 -0600 Subject: [PATCH] Fixed tabbing issue --- bin/python-tool | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/python-tool b/bin/python-tool index e7ff8c0..97b1ae0 100644 --- a/bin/python-tool +++ b/bin/python-tool @@ -18,7 +18,7 @@ if __name__ == '__main__': # Gather Argument options EXAMPLE_TEXT='Example:\n\tpython-tool -h' parser = argparse.ArgumentParser(epilog=EXAMPLE_TEXT,formatter_class=argparse.RawDescriptionHelpFormatter) - ##CONFIG_parser.add_argument('-c', '--config', action='store', help='Specify a config file (~/.config/python-tool.yml)',default='~/.config/python-tool.yml') +##CONFIG_ parser.add_argument('-c', '--config', action='store', help='Specify a config file (~/.config/python-tool.yml)',default='~/.config/python-tool.yml') parser.add_argument('-H', '--hosts', action='append', default=None, help='Collects arguments in an array.') parser.add_argument('-d', '--dry-run', action='store_true', help='Store the existence of a variable.') parser.add_argument('-l', '--log', action='store', help='Specify a file to log to.') @@ -32,15 +32,15 @@ if __name__ == '__main__': if args.log : logging.basicConfig(level=logging.INFO,filename=args.log) - ##CONFIG_# Parse config - ##CONFIG_try : - ##CONFIG_ config_path = os.path.normpath(args.config) - ##CONFIG_ file_descriptor = open(os.path.normpath(os.path.expanduser(os.path.expandvars(config_path)))) - ##CONFIG_ config = yaml.safe_load(file_descriptor) - ##CONFIG_ if not isinstance(config,dict) : - ##CONFIG_ raise ValueError('expected dictonary as top-level yaml object') - ##CONFIG_except Exception as e : - ##CONFIG_ debug("Unable to parse config: " + str(e),0) +##CONFIG_ # Parse config +##CONFIG_ try : +##CONFIG_ config_path = os.path.normpath(args.config) +##CONFIG_ file_descriptor = open(os.path.normpath(os.path.expanduser(os.path.expandvars(config_path)))) +##CONFIG_ config = yaml.safe_load(file_descriptor) +##CONFIG_ if not isinstance(config,dict) : +##CONFIG_ raise ValueError('expected dictonary as top-level yaml object') +##CONFIG_ except Exception as e : +##CONFIG_ debug("Unable to parse config: " + str(e),0) # Main functions print('Hello World!')