Main entry point
()
| 337 | |
| 338 | |
| 339 | def main(): |
| 340 | """Main entry point""" |
| 341 | try: |
| 342 | # Parse arguments |
| 343 | args = parse_args() |
| 344 | |
| 345 | # Auto-detect input type if not specified |
| 346 | input_type = args.input_type or detect_input_type(args.input) |
| 347 | |
| 348 | # Validate input |
| 349 | input_content, input_type = validate_input(args.input, input_type) |
| 350 | |
| 351 | # Create output directory |
| 352 | output_dir = create_output_dir(args) |
| 353 | |
| 354 | # Run workflow |
| 355 | final_state = asyncio.run(run_paper2figure_workflow(args, input_content, input_type, output_dir)) |
| 356 | |
| 357 | # Print results |
| 358 | print_results(final_state, output_dir, args.graph_type) |
| 359 | |
| 360 | return 0 |
| 361 | |
| 362 | except FileNotFoundError as e: |
| 363 | log.error("%s", e) |
| 364 | return 1 |
| 365 | except ValueError as e: |
| 366 | log.error("%s", e) |
| 367 | return 1 |
| 368 | except Exception as e: |
| 369 | log.exception("Workflow execution failed: %s", e) |
| 370 | import traceback |
| 371 | traceback.print_exc() |
| 372 | return 1 |
| 373 | |
| 374 | |
| 375 | if __name__ == "__main__": |
no test coverage detected