Check that the paths are valid. :param vtk_src_dir: The path to the VTK source. :param application_srcs: The user source files to be scanned for modules. :return: True if paths, files exist.
(vtk_src_dir, application_srcs)
| 32 | |
| 33 | |
| 34 | def check_paths(vtk_src_dir, application_srcs): |
| 35 | """ |
| 36 | Check that the paths are valid. |
| 37 | |
| 38 | :param vtk_src_dir: The path to the VTK source. |
| 39 | :param application_srcs: The user source files to be scanned for modules. |
| 40 | :return: True if paths, files exist. |
| 41 | """ |
| 42 | ok = True |
| 43 | if not Path(vtk_src_dir).is_dir(): |
| 44 | print('The path to your VTK Source folder does not exist.') |
| 45 | print(Path(vtk_src_dir)) |
| 46 | ok = False |
| 47 | bad_paths = list() |
| 48 | for f in application_srcs: |
| 49 | p = Path(f) |
| 50 | if not (p.is_dir() or p.is_file()): |
| 51 | bad_paths.append(p) |
| 52 | if bad_paths: |
| 53 | print('These application paths or files do not exist.') |
| 54 | for p in bad_paths: |
| 55 | print(p) |
| 56 | ok = False |
| 57 | return ok |
| 58 | |
| 59 | |
| 60 | def find_vtk_modules(vtk_src_dir): |