| 6 | |
| 7 | |
| 8 | def check_file(dilate_path, filename): |
| 9 | executable_path = os.path.join(dilate_path, "dilate") |
| 10 | try: |
| 11 | with subprocess.Popen( |
| 12 | [executable_path, "--dry-run", filename], |
| 13 | stdout=subprocess.PIPE, |
| 14 | stderr=subprocess.PIPE, |
| 15 | ) as process: |
| 16 | process.communicate() |
| 17 | not_dilated = process.returncode != 0 |
| 18 | if not_dilated: |
| 19 | print(f"Error: '{filename}' is not dilated.") |
| 20 | return not_dilated |
| 21 | except FileNotFoundError: |
| 22 | print(f"Error: Executable not found at '{executable_path}'.") |
| 23 | return 1 |
| 24 | |
| 25 | |
| 26 | def check_dir(dilate_path, directory): |