()
| 89 | return os.path.basename(os.path.dirname(plugin_name)) + "/" + os.path.basename(plugin_name).replace(".json", "") |
| 90 | |
| 91 | def generate_header_file(): |
| 92 | # put literal quotes around the base64s |
| 93 | header_src = open(HEADER_SRC_PATH, "r").read() |
| 94 | asset_lib_base64s = get_base64s_from_dir(ASSET_LIB_PRECACHE_DIR) |
| 95 | github_base64s = get_base64s_from_dir(GITHUB_PRECACHE_DIR) |
| 96 | gitlab_base64s = get_base64s_from_dir(GITLAB_PRECACHE_DIR) |
| 97 | |
| 98 | asset_lib_base64s = [(get_asset_lib_plugin_name(file_path), base64) for file_path, base64 in asset_lib_base64s] |
| 99 | github_base64s = [(get_plugin_name_from_file(file_path), base64) for file_path, base64 in github_base64s] |
| 100 | gitlab_base64s = [(get_plugin_name_from_file(file_path), base64) for file_path, base64 in gitlab_base64s] |
| 101 | |
| 102 | asset_lib_base64_strs = [f'{{"{plugin_name}", "{base64}"}}' for plugin_name, base64 in asset_lib_base64s] |
| 103 | github_base64_strs = [f'{{"{plugin_name}", "{base64}"}}' for plugin_name, base64 in github_base64s] |
| 104 | gitlab_base64_strs = [f'{{"{plugin_name}", "{base64}"}}' for plugin_name, base64 in gitlab_base64s] |
| 105 | header_src = header_src.replace(ASSET_LIB_PRECACHE_HEADER_START, ",\n".join(asset_lib_base64_strs)) |
| 106 | header_src = header_src.replace(GITHUB_PRECACHE_HEADER_START, ",\n".join(github_base64_strs)) |
| 107 | header_src = header_src.replace(GITLAB_PRECACHE_HEADER_START, ",\n".join(gitlab_base64_strs)) |
| 108 | with open(HEADER_DST_PATH, "w") as f: |
| 109 | f.write(header_src) |
| 110 | |
| 111 | |
| 112 | def generate_json_file(): |
nothing calls this directly
no test coverage detected