예제 #1
0
def build_all(file_data, output=None):
    input = clean_json(json.loads(file_data.decode('ascii', 'ignore')))
    validation_warnings, validation_errors = validate_spec(input)
    build_data = ""
    build_errors = []
    if not validation_errors:
        new_package = compile_spec(input)
        files = {}
        files.update(build_python(to_dict(new_package)))
        files.update(build_java(to_dict(new_package)))
        files.update(build_racket(to_dict(new_package)))
        if output is None:
            build_data, build_errors = build_zip(files)
        else:
            build_data, build_errors = build_dir(files, output)
    return validation_warnings, validation_errors, build_data, build_errors
예제 #2
0
def build_all(file_data, output=None):
    input = clean_json(json.loads(file_data.decode('ascii', 'ignore')))
    validation_warnings, validation_errors = validate_spec(input)
    build_data = ""
    build_errors = []
    if not validation_errors:
        new_package = compile_spec(input)
        files = {}
        files.update(build_python(to_dict(new_package)))
        files.update(build_java(to_dict(new_package)))
        files.update(build_racket(to_dict(new_package)))
        if output is None:
            build_data, build_errors = build_zip(files)
        else:
            build_data, build_errors = build_dir(files, output)
    return validation_warnings, validation_errors, build_data, build_errors
예제 #3
0
    if not fast:
        new_file, database_file = build_database(model)
        sql_file = name+".sql"
        build_locals(model, database_file, sql_file)
        database_file.close()
        moves = {new_file: new_folder, sql_file: new_folder}
        for appendix in model['metadata']['appendix']:
            moves[appendix['file']] = new_folder
    else:
        moves = {}
    
    return files, moves
    
if __name__ == "__main__":
    import json
    from auxiliary import clean_json
    input = clean_json(json.load(open(sys.argv[1],'r')))
    from validate import validate_spec
    warnings, errors = validate_spec(input)
    for warning in warnings:
        print("Warning!", warning)
    if not errors:
        from compile import compile_spec
        new_package = compile_spec(input)
        files = build_sql(to_dict(new_package))
        from build import build_dir
        build_dir(files, sys.argv[2])
    else:
        for error in errors:
            print("Error!", error)
예제 #4
0
    if not fast:
        new_file, database_file = build_database(model)
        build_locals(model, database_file)
        
        database_file.close()
        moves = {new_file: new_folder}
        for appendix in model['metadata']['appendix']:
            moves[appendix['file']] = new_folder
    else:
        moves = {}
    
    return files, moves
    
if __name__ == "__main__":
    import json
    from auxiliary import clean_json
    input = clean_json(json.load(open(sys.argv[1],'r')))
    from validate import validate_spec
    warnings, errors = validate_spec(input)
    for warning in warnings:
        print "Warning!", warning
    if not errors:
        from compile import compile_spec
        new_package = compile_spec(input)
        files = build_python(to_dict(new_package))
        from build import build_dir
        build_dir(files, sys.argv[2])
    else:
        for error in errors:
            print "Error!", error