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

Function validate_input_file

script/run_pdf2ppt_cli.py:147–157  ·  view source on GitHub ↗

Validate input file exists and has correct extension

(file_path: str)

Source from the content-addressed store, hash-verified

145
146
147def validate_input_file(file_path: str) -> Path:
148 """Validate input file exists and has correct extension"""
149 path = Path(file_path)
150
151 if not path.exists():
152 raise FileNotFoundError(f"Input file not found: {file_path}")
153
154 if path.suffix.lower() != ".pdf":
155 raise ValueError(f"Invalid file type. Expected .pdf, got {path.suffix}")
156
157 return path.resolve()
158
159
160def create_output_dir(args) -> Path:

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected