INNER CODE UNIT · Python

validate_deb

witchan/ios-mcp · scripts/submit_bigboss_update.py:85

def validate_deb(path: str) -> Path:
    deb = Path(path)
    if not deb.is_file():
        raise FileNotFoundError(f"deb file not found: {deb}")
    if deb.suffix != ".deb":
        raise ValueError(f"expected a .deb file: {deb}")
    return deb


def guess_content_type(path: Path) -> str:
    if path.suffix == ".deb":
        return "application/vnd.debian.binary-package"
    guessed, _ = mimetypes.guess_type(path.name)
    return guessed or "application/octet-stream"


def multipart_body(
    fields: Iterable[tuple[str, str]],

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…