style: add return type hints to all function signatures
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -39,7 +39,7 @@ def curl_download(url: str, dest: Path) -> bool:
|
|||||||
return result.returncode == 0
|
return result.returncode == 0
|
||||||
|
|
||||||
|
|
||||||
def download_files():
|
def download_files() -> bool:
|
||||||
"""Download split archive volumes (z01..zNN) then cache.zip, stopping volumes at 404 or MAX_PARTS."""
|
"""Download split archive volumes (z01..zNN) then cache.zip, stopping volumes at 404 or MAX_PARTS."""
|
||||||
print("Downloading jlcparts database (~421MB)...")
|
print("Downloading jlcparts database (~421MB)...")
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ def download_files():
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def extract_database():
|
def extract_database() -> bool:
|
||||||
"""Extract the split 7z archive to get cache.sqlite3."""
|
"""Extract the split 7z archive to get cache.sqlite3."""
|
||||||
cache_sqlite = CACHE_DIR / "cache.sqlite3"
|
cache_sqlite = CACHE_DIR / "cache.sqlite3"
|
||||||
if cache_sqlite.exists() and cache_sqlite.stat().st_size > 100_000_000:
|
if cache_sqlite.exists() and cache_sqlite.stat().st_size > 100_000_000:
|
||||||
@@ -97,7 +97,7 @@ def extract_database():
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def convert_to_mcp_format():
|
def convert_to_mcp_format() -> bool:
|
||||||
"""Convert jlcparts cache.sqlite3 to the MCP server's expected format."""
|
"""Convert jlcparts cache.sqlite3 to the MCP server's expected format."""
|
||||||
source = CACHE_DIR / "cache.sqlite3"
|
source = CACHE_DIR / "cache.sqlite3"
|
||||||
if not source.exists():
|
if not source.exists():
|
||||||
@@ -289,7 +289,7 @@ def convert_to_mcp_format():
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main() -> None:
|
||||||
print("=" * 60)
|
print("=" * 60)
|
||||||
print("JLCPCB Parts Database Downloader (jlcparts method)")
|
print("JLCPCB Parts Database Downloader (jlcparts method)")
|
||||||
print("=" * 60)
|
print("=" * 60)
|
||||||
|
|||||||
Reference in New Issue
Block a user