Portability: Blender/ODA discovery via env > PATH > macOS default
The two hardcoded macOS paths in code become last-resort defaults:
- build_showcase_variants: env BLENDER > shutil.which("blender") > app bundle
- cad_dxf_report: env ODA_CONVERTER > shutil.which("ODAFileConverter") > app
bundle (env override existed already; PATH lookup is new)
Docs annotate the macOS example paths with the discovery order.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -86,10 +86,13 @@ def run_dwg2dxf(source: Path, dest: Path) -> dict:
|
||||
|
||||
|
||||
def oda_converter() -> str | None:
|
||||
"""ODA File Converter path (env ODA_CONVERTER overrides the macOS default)."""
|
||||
"""ODA File Converter: env ODA_CONVERTER > PATH > macOS app-bundle default."""
|
||||
override = os.environ.get("ODA_CONVERTER")
|
||||
if override:
|
||||
return override if Path(override).exists() else None
|
||||
found = shutil.which("ODAFileConverter")
|
||||
if found:
|
||||
return found
|
||||
default = Path("/Applications/ODAFileConverter.app/Contents/MacOS/ODAFileConverter")
|
||||
return str(default) if default.exists() else None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user