(input, spec)
| 365 | |
| 366 | @staticmethod |
| 367 | def validate(input, spec): |
| 368 | if not input and (not spec.get("required", None) or spec.get("default", None)): |
| 369 | return |
| 370 | |
| 371 | for m in re.finditer(r"[^, ]+", input): |
| 372 | index, item = m.start(), m.group() |
| 373 | try: |
| 374 | EnumReader.validate(item, spec.get("items", {})) |
| 375 | except validation.ValidationError as e: |
| 376 | raise validation.ValidationError(index, six.text_type(e)) |
| 377 | |
| 378 | def _construct_template(self): |
| 379 | self.template = "{0}: " |