MCPcopy Create free account
hub / github.com/ComfyWorkflows/ComfyUI-Launcher / load_json_files

Function load_json_files

server/tests.py:16–28  ·  view source on GitHub ↗
(directory)

Source from the content-addressed store, hash-verified

14import uuid
15
16def load_json_files(directory):
17 print(f"load_json_files 1. loading json files for dir: {directory}")
18 json_files = []
19 for root, _, files in os.walk(directory):
20 print(f"load_json_files 2. FILEs in dir: {files}")
21 for file in files:
22 print(f"load_json_files 3. FILE in dir: {files}")
23 if file.endswith('.json'):
24 print(f"load_json_files 3. FILE ends w/ json, opening.")
25 with open(os.path.join(root, file), 'r') as f:
26 json_data = json.load(f)
27 json_files.append((os.path.join(root, file), json_data))
28 return json_files
29
30def replace_filepaths(json_obj):
31 script_dir = os.path.dirname(__file__)

Callers 1

run_testsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected