Пример #1
0
 def _validate(self, options):
     """ Raises a ValidationError if validation fails. """
     failed = validate(options)
     if not 'url' in options or not validate_url(options['url']):
         failed.append('url')
     if len(failed) > 0:
         raise ValidationError('Validation error.', failed)
Пример #2
0
 def _validate(self, options):
     """ Raises a ValidationError if validation fails. """
     
     failed = validate(options)
     if not 'pattern' in options or not 'intervals' in options['pattern'] \
     or not validate_list(options['pattern']['intervals']):
         failed.append('pattern')
     if len(failed) > 0:
         raise ValidationError('Validation error.', failed)
Пример #3
0
    def _validate(self, options):
        """ Raises a ValidationError if validation fails. """
        failed = validate(options)
        if not "url" in options or not validate_url(options["url"]):
            failed.append("url")

        if (
            not "pattern" in options
            or not "intervals" in options["pattern"]
            or not validate_list(options["pattern"]["intervals"])
        ):
            failed.append("pattern")
        if len(failed) > 0:
            raise ValidationError("Validation error.", failed)
Пример #4
0
    def _validate(self, options):
        """ Raises a ValidationError if validation fails. """

        failed = validate(options)
        if len(failed) > 0:
            raise ValidationError('Validation error.', failed)
Пример #5
0
 def _validate(self, options):
     """ Raises a ValidationError if validation fails. """
     failed = validate(options)
     if len(failed) > 0:
         raise ValidationError('Validation error.', failed)