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

Function validate_input_file

script/run_ppt2polish_cli.py:133–143  ·  view source on GitHub ↗

Validate input file exists and has correct extension

(file_path: str)

Source from the content-addressed store, hash-verified

131
132
133def validate_input_file(file_path: str) -> Path:
134 """Validate input file exists and has correct extension"""
135 path = Path(file_path)
136
137 if not path.exists():
138 raise FileNotFoundError(f"Input file not found: {file_path}")
139
140 if path.suffix.lower() not in [".pptx", ".ppt"]:
141 raise ValueError(f"Invalid file type. Expected .pptx or .ppt, got {path.suffix}")
142
143 return path.resolve()
144
145
146def create_output_dir(args) -> Path:

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected