Esempio n. 1
0
 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
Esempio n. 2
0
 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)
Esempio n. 3
0
 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]