Beispiel #1
0
def run_tool(result_folder):
    f_configuration_path = join(result_folder, 'f.cfg')
    x_configuration_path = join(result_folder, 'x.cfg')
    target_folder = join(result_folder, 'y')
    tool_definition = load_tool_definition(f_configuration_path)
    result_arguments = load_result_arguments(x_configuration_path)
    environment = load_settings(x_configuration_path, 'result_environment')
    return run_script(tool_definition, result_arguments, result_folder,
                      target_folder, environment)
Beispiel #2
0
def run_tool(result_folder):
    f_configuration_path = join(result_folder, 'f.cfg')
    x_configuration_path = join(result_folder, 'x.cfg')
    target_folder = join(result_folder, 'y')
    tool_definition = load_tool_definition(f_configuration_path)
    result_arguments = load_result_arguments(x_configuration_path)
    environment = load_settings(x_configuration_path, 'result_environment')
    return run_script(
        tool_definition, result_arguments, result_folder, target_folder,
        environment)
Beispiel #3
0
def send_result_response(endpoint_url, result_folder):
    result_token = open(join(result_folder, 'y.token')).read()
    result_properties = load_settings(join(
        result_folder, 'y.cfg'), 'result_properties')  # Assume relative paths
    response = requests.post(endpoint_url, headers={
        'Authorization': 'Bearer ' + result_token,
    }, data={
        'result_progress': 100,
        'result_properties': json.dumps(result_properties),
    }, files={
        'target_folder': open(compress_zip(join(result_folder, 'y')), 'rb'),
    })
    if response.status_code == 400:
        raise HTTPBadRequest
Beispiel #4
0
def send_result_response(endpoint_url, result_folder):
    result_token = open(join(result_folder, 'y.token')).read()
    result_properties = load_settings(join(
        result_folder, 'y.cfg'), 'result_properties')  # Assume relative paths
    response = requests.post(endpoint_url,
                             headers={
                                 'Authorization': 'Bearer ' + result_token,
                             },
                             data={
                                 'result_progress':
                                 100,
                                 'result_properties':
                                 json.dumps(result_properties),
                             },
                             files={
                                 'target_folder':
                                 open(compress_zip(join(result_folder, 'y')),
                                      'rb'),
                             })
    if response.status_code == 400:
        raise HTTPBadRequest