zcbot/skills/ppt/scripts/svg_to_pptx.py

31 lines
1.2 KiB
Python

#!/usr/bin/env python3
"""PPT Master - SVG to PPTX Tool (thin wrapper).
Delegates to the svg_to_pptx package. Kept for CLI backward compatibility:
python3 scripts/svg_to_pptx.py <project_path>
Do NOT pass `-s final` by default: native export reads svg_output/ (the
authored source; icons/preserveAspectRatio handled by the converter). A real
run that copied `-s final` from an old docstring here cascaded into a false
icon-gate alarm and hand-patched image paths in the sources.
"""
import sys
try: # zcbot: Windows GBK 控制台兼容,避免 emoji/© 等触发 UnicodeEncodeError
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
sys.stderr.reconfigure(encoding="utf-8", errors="replace")
except Exception:
pass
from pathlib import Path
# Ensure the scripts directory is on sys.path so the package can be found
sys.path.insert(0, str(Path(__file__).resolve().parent))
from svg_to_pptx import main
if __name__ == '__main__':
# Propagate main()'s return code as the process exit code — otherwise every
# `return 1` guard in main() (icon gate / no-SVG / bad path) silently exits 0
# and callers (and `&&` chains) can't tell success from a refused export.
sys.exit(main())