MCPcopy Create free account
hub / github.com/OpenDCAI/Paper2Any / main

Function main

script/run_ppt2polish_cli.py:356–403  ·  view source on GitHub ↗

Main entry point

()

Source from the content-addressed store, hash-verified

354
355
356def main():
357 """Main entry point"""
358 try:
359 # Parse arguments
360 args = parse_args()
361
362 # Validate input file
363 input_path = validate_input_file(args.input)
364
365 # Create output directory
366 output_dir = create_output_dir(args)
367
368 log.info("%s", "=" * 60)
369 log.info("PPT2Polish - Step 1: Convert PPTX to Images")
370 log.info("%s", "=" * 60)
371
372 # Step 1: Convert PPTX to PDF
373 pdf_path = convert_pptx_to_pdf(input_path, output_dir)
374
375 # Step 2: Convert PDF to images
376 image_paths = convert_pdf_to_images(pdf_path, output_dir)
377
378 log.info("%s", "=" * 60)
379 log.info("PPT2Polish - Step 2: Beautify Slides")
380 log.info("%s", "=" * 60)
381
382 # Step 3: Run workflow to beautify slides
383 final_state = asyncio.run(run_ppt2polish_workflow(args, image_paths, output_dir))
384
385 # Print results
386 print_results(final_state, output_dir)
387
388 return 0
389
390 except FileNotFoundError as e:
391 log.error("%s", e)
392 return 1
393 except ValueError as e:
394 log.error("%s", e)
395 return 1
396 except RuntimeError as e:
397 log.error("%s", e)
398 return 1
399 except Exception as e:
400 log.exception("Workflow execution failed: %s", e)
401 import traceback
402 traceback.print_exc()
403 return 1
404
405
406if __name__ == "__main__":

Callers 1

Calls 8

convert_pptx_to_pdfFunction · 0.85
convert_pdf_to_imagesFunction · 0.85
run_ppt2polish_workflowFunction · 0.85
parse_argsFunction · 0.70
validate_input_fileFunction · 0.70
create_output_dirFunction · 0.70
print_resultsFunction · 0.70
runMethod · 0.45

Tested by

no test coverage detected