def load_schema(path): path = path.replace(".", os.sep) + ".yml" meta = yaml_load(open(path)) if "$schema" in meta: schema = yaml_load(open(meta["$schema"])) jsonschema.validate(meta, schema) else: print >> sys.stderr, "No validation for", path # schema = extract_schema(meta) return list(extract_orm(meta))
def load_schema(path): path = path.replace('.', os.sep)+'.yml' try: meta = yaml_load(open(path)) except Exception, e: print e raise Exception("Error loading %s from %s" % (path, os.getcwd()), e)
def yaml_reader(file, ctx): return yaml_load(file)