| 14 | import uuid |
| 15 | |
| 16 | def 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 | |
| 30 | def replace_filepaths(json_obj): |
| 31 | script_dir = os.path.dirname(__file__) |