INNER CODE UNIT · Python

get_file_as_string

fescobar/allure-docker-service · allure-docker-api/app.py:352

def get_file_as_string(path_file):
    file = None
    content = None
    try:
        file = open(path_file, "r")
        content = file.read()
    finally:
        if file is not None:
            file.close()
    return content

def get_security_specs():
    security_specs = {}
    for file in os.listdir("{}/{}/".format(STATIC_CONTENT, SECURITY_SPECS_PATH)):
        file_path = "{}/{}/{}".format(STATIC_CONTENT, SECURITY_SPECS_PATH, file)
        security_specs[file] = eval(get_file_as_string(file_path)) #pylint: disable=eval-used
    return security_specs

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…