comparison validateyaml/main.py @ 1:99c252285817 default tip

CamelCase
author Jeff Hammel <k0scist@gmail.com>
date Tue, 01 Nov 2016 16:09:09 -0700
parents c00f27542710
children
comparison
equal deleted inserted replaced
0:c00f27542710 1:99c252285817
14 """CLI option parser""" 14 """CLI option parser"""
15 def __init__(self, **kwargs): 15 def __init__(self, **kwargs):
16 kwargs.setdefault('formatter_class', argparse.RawTextHelpFormatter) 16 kwargs.setdefault('formatter_class', argparse.RawTextHelpFormatter)
17 kwargs.setdefault('description', __doc__) 17 kwargs.setdefault('description', __doc__)
18 argparse.ArgumentParser.__init__(self, **kwargs) 18 argparse.ArgumentParser.__init__(self, **kwargs)
19 self.add_argument('yaml_file', type=argparse.filetype('r')) 19 self.add_argument('yaml_file', type=argparse.FileType('r'))
20 self.options = None 20 self.options = None
21 21
22 def parse_args(self, *args, **kw): 22 def parse_args(self, *args, **kw):
23 options = argparse.ArgumentParser.parse_args(self, *args, **kw) 23 options = argparse.ArgumentParser.parse_args(self, *args, **kw)
24 self.validate(options) 24 self.validate(options)