def expand_default(self, option):
 if ((self.parser is None) or (not self.default_tag)):
  return option.help
 optname = option._long_opts[0][2:]
 try:
  provider = self.parser.options_manager._all_options[optname]
 except KeyError:
  value = None
 else:
  optdict = provider.get_option_def(optname)
  optname = provider.option_attrname(optname, optdict)
  value = getattr(provider.config, optname, optdict)
  value = format_option_value(optdict, value)
 if ((value is optik_ext.NO_DEFAULT) or (not value)):
  value = self.NO_DEFAULT_VALUE
 return option.help.replace(self.default_tag, str(value))

def expand_default ( self , option ) : if ( ( self . parser is None ) or ( not self . default_tag ) ) : return option . help optname = option . _long_opts [ 0 ] [ 2 : ] try : provider = self . parser . options_manager . _all_options [ optname ] except KeyError : value = None else : optdict = provider . get_option_def ( optname ) optname = provider . option_attrname ( optname , optdict ) value = getattr ( provider . config , optname , optdict ) value = format_option_value ( optdict , value ) if ( ( value is optik_ext . NO_DEFAULT ) or ( not value ) ) : value = self . NO_DEFAULT_VALUE return option . help . replace ( self . default_tag , str ( value ) )
monkey patch optionparser .