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

Function main

script/run_paper2figure_cli.py:339–372  ·  view source on GitHub ↗

Main entry point

()

Source from the content-addressed store, hash-verified

337
338
339def 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
375if __name__ == "__main__":

Callers 1

Calls 7

parse_argsFunction · 0.70
detect_input_typeFunction · 0.70
validate_inputFunction · 0.70
create_output_dirFunction · 0.70
print_resultsFunction · 0.70
runMethod · 0.45

Tested by

no test coverage detected