Main entry point for command-line usage.
()
| 354 | |
| 355 | |
| 356 | def main(): |
| 357 | """Main entry point for command-line usage.""" |
| 358 | if len(sys.argv) != 4: |
| 359 | print(__doc__) |
| 360 | sys.exit(1) |
| 361 | |
| 362 | input_pptx = Path(sys.argv[1]) |
| 363 | replacements_json = Path(sys.argv[2]) |
| 364 | output_pptx = Path(sys.argv[3]) |
| 365 | |
| 366 | if not input_pptx.exists(): |
| 367 | print(f"Error: Input file '{input_pptx}' not found") |
| 368 | sys.exit(1) |
| 369 | |
| 370 | if not replacements_json.exists(): |
| 371 | print(f"Error: Replacements JSON file '{replacements_json}' not found") |
| 372 | sys.exit(1) |
| 373 | |
| 374 | try: |
| 375 | apply_replacements(str(input_pptx), str(replacements_json), str(output_pptx)) |
| 376 | except Exception as e: |
| 377 | print(f"Error applying replacements: {e}") |
| 378 | import traceback |
| 379 | |
| 380 | traceback.print_exc() |
| 381 | sys.exit(1) |
| 382 | |
| 383 | |
| 384 | if __name__ == "__main__": |
no test coverage detected