Re: OptParse and Constant values

2010-08-12 Thread J
On Thu, Aug 12, 2010 at 12:41, Robert Kern wrote: > On 8/12/10 11:19 AM, J wrote: >> >> How do you use OptParse with constants? > http://docs.python.org/library/optparse#standard-option-actions > > 'store_const' means that the option is a flag without arguments and stores > the value provided by

Re: OptParse and Constant values

2010-08-12 Thread Robert Kern
On 8/12/10 11:19 AM, J wrote: How do you use OptParse with constants? Example: usage = 'Usage: %prog [OPTIONS]' parser = OptionParser(usage) parser.add_option('-l','--level', action='store_const', default=LOG_INFO, he

OptParse and Constant values

2010-08-12 Thread J
How do you use OptParse with constants? Example: usage = 'Usage: %prog [OPTIONS]' parser = OptionParser(usage) parser.add_option('-l','--level', action='store_const', default=LOG_INFO, help='Set the log level to inject into