def _validate(self, data): if not data.variables: raise DataError('FOR loop has no loop variables.') for var in data.variables: if not is_scalar_var(var): raise DataError("Invalid FOR loop variable '%s'." % var) if not data.values: raise DataError('FOR loop has no loop values.') if not data.keywords: raise DataError('FOR loop contains no keywords.')
def _format_arg(self, arg): if not is_scalar_var(arg): self._raise_invalid_spec("Invalid argument syntax '%s'." % arg) return arg[2:-1]