comparison cmd2.py @ 298:a94e3b39d787

connect2 changes in progress
author catherine@bothari
date Mon, 25 Jan 2010 10:05:51 -0500
parents ab340dfd2e14
children 7d256086fa1b
comparison
equal deleted inserted replaced
297:ab340dfd2e14 298:a94e3b39d787
101 def do_something(self, arg, opts): 101 def do_something(self, arg, opts):
102 if opts.quick: 102 if opts.quick:
103 self.fast_button = True 103 self.fast_button = True
104 ''' 104 '''
105 if not isinstance(option_list, list): 105 if not isinstance(option_list, list):
106 option_list = [option_list] 106 option_list = [option_list]
107 def option_setup(func): 107 def option_setup(func):
108 optionParser = OptionParser() 108 optionParser = OptionParser()
109 for opt in option_list: 109 for opt in option_list:
110 optionParser.add_option(opt) 110 optionParser.add_option(opt)
111 optionParser.set_usage("%s [options] arg" % func.__name__.strip('do_')) 111 optionParser.set_usage("%s [options] arg" % func.__name__.strip('do_'))
323 abbrev = True # Abbreviated commands recognized 323 abbrev = True # Abbreviated commands recognized
324 current_script_dir = None 324 current_script_dir = None
325 reserved_words = [] 325 reserved_words = []
326 feedback_to_output = False # Do include nonessentials in >, | output 326 feedback_to_output = False # Do include nonessentials in >, | output
327 quiet = False # Do not suppress nonessential output 327 quiet = False # Do not suppress nonessential output
328 debug = False 328 debug = True
329 settable = ''' 329 settable = '''
330 prompt 330 prompt
331 continuation_prompt 331 continuation_prompt
332 debug 332 debug
333 default_file_name for `save`, `load`, etc. 333 default_file_name for `save`, `load`, etc.