예제 #1
0
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))
예제 #2
0
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)
예제 #3
0
def yaml_reader(file, ctx):
    return yaml_load(file)