def boolean_or_string(self, value): if not value: raise validate.VdtMissingValue('No value for this option') try: caster = self.validator.functions.get('boolean') return caster(value) except validate.VdtTypeError: return value
def force_string(value): if not value: raise validate.VdtMissingValue('No value for this option') if not isinstance(value, list): return str(value) return ','.join(value)
def string_lower_list(value): if not value: raise validate.VdtMissingValue('No value for this option') if not isinstance(value, list): return [str(value).lower()] return [str(x).lower() for x in value]