(self,*args,**kwargs)
| 50 | self.exit(os.EX_USAGE) |
| 51 | |
| 52 | def parse_args(self,*args,**kwargs): |
| 53 | options,arguments = OptionParser.parse_args(self,*args,**kwargs) |
| 54 | |
| 55 | def prune_options(options,alist): |
| 56 | """Given 'options' -- a list of arguments to OptionParser.add_option, |
| 57 | and a set of optparse Values, return a dictionary of only those values |
| 58 | that apply exclusively to 'options'""" |
| 59 | return dict( [ (k,getattr(options,k)) for k in dir(options) if k in alist ] ) |
| 60 | |
| 61 | api_options = prune_options(options,self.api_dests) |
| 62 | cmd_options = prune_options(options,self.cmd_dests) |
| 63 | |
| 64 | return options,arguments,api_options,cmd_options |
| 65 | |
| 66 | |
| 67 | def get_parser(api_callable=None,cmd_callable=None): # this should probably be the __init__ method of myoptionparser |
no outgoing calls
no test coverage detected