MCPcopy Index your code
hub / github.com/ChinaGodMan/UserScripts / get_new_content

Function get_new_content

utils/update_shields.py:16–28  ·  view source on GitHub ↗
(script_directory, lang_code="")

Source from the content-addressed store, hash-verified

14
15
16def get_new_content(script_directory, lang_code=""):
17 with open(NEW_CONTENT_PATH, 'r', encoding='utf-8') as file:
18 content = file.read()
19 new_content = format_str(content, lang_code)
20 # 判断目录下的passed.json
21 if os.path.exists(script_directory + "/docs/passed.json"):
22 URL = f"https://github.com/{get_repo_name()}/raw/main/{script_directory}/docs/passed.json"
23 else:
24 URL = f"https://github.com/{get_repo_name()}/raw/main/docs/passed.json"
25 new_content = new_content.format(
26 PASSED_URL=URL
27 )
28 return new_content
29
30
31def main():

Callers 1

mainFunction · 0.70

Calls 2

format_strFunction · 0.90
get_repo_nameFunction · 0.90

Tested by

no test coverage detected