'Call the validator function on applicable settings and
evaluate the \'overrides\' option.
Extends `optparse.Option.process`.'

def process(self, opt, value, values, parser):

    result = optparse.Option.process(self, opt, value, values, parser)
    setting = self.dest
    if setting:
        if self.validator:
            value = getattr(values, setting)
            try:
                new_value = self.validator(setting, value, parser)
            except Exception as error:
                raise (optparse.OptionValueError(('Error    in    option    "%s":\n                %s:    %s' % (opt, error.__class__.__name__, error))), None, sys.exc_info()[2])
            setattr(values, setting, new_value)
        if self.overrides:
            setattr(values, self.overrides, None)
    return result
