def option_callback(option, opt, value, par, switch): #@UnusedVariable try: set_config_from_strings(switch.name, value) except: raise OptionValueError( 'Could not parse value "%s" passed to "%s".' % (value, opt))
def config(args): ''' Get/set configuration parameters. Call like: @> config <switch> <value> Without arguments, shows all configuration switches. ''' if not args: # show show_config(sys.stdout) return name = args.pop(0) if not args: if not name in config_switches: raise UserError("I don't know the switch '%s'." % name) info('config %s %s' % (name, compmake_config.__dict__[name])) return set_config_from_strings(name, args)