(root_dir, file)
| 59 | |
| 60 | |
| 61 | def get_file(root_dir, file): |
| 62 | if file == "[none]" or not file or not file.strip(): |
| 63 | raise ValueError("No file") |
| 64 | |
| 65 | root_dir = get_dir_from_name(root_dir) |
| 66 | root_dir = get_real_path(root_dir) |
| 67 | if not os.path.exists(root_dir): |
| 68 | os.mkdir(root_dir) |
| 69 | full_path = os.path.join(root_dir, file) |
| 70 | |
| 71 | file_dir = os.path.dirname(full_path) |
| 72 | if file_dir and not os.path.exists(file_dir): |
| 73 | os.makedirs(file_dir, exist_ok=True) |
| 74 | |
| 75 | if not is_child_dir(root_dir, full_path): |
| 76 | raise ReferenceError() |
| 77 | |
| 78 | return full_path |
| 79 | |
| 80 | |
| 81 | class TextFileNode: |
no test coverage detected