Spaces:
Running
Running
sync: upstream 9194f15 + custom addons (KeyRotator, RotatingChatTransport, sol/terra/luna, ScannerTrap, health, Py3.12 compat)
e99df76 Download src/free_claude_code/cli/desktop_assets.py from dherain24/claude-proxy: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/spaces/dherain24/claude-proxy/resolve/main/src/free_claude_code/cli/desktop_assets.py
- Command line
-
hf download hf://spaces/dherain24/claude-proxy/src/free_claude_code/cli/desktop_assets.py
-
curl -L -o desktop_assets.py https://huggingface.co/spaces/dherain24/claude-proxy/resolve/main/src/free_claude_code/cli/desktop_assets.py
1.01 kB
| from __future__ import annotations | |
| """Packaged visual assets owned by the FCC desktop shell.""" | |
| from importlib.resources import files | |
| from pathlib import Path | |
| _ICON_FILES = { | |
| ".icns": "app-icon.icns", | |
| ".ico": "app-icon.ico", | |
| ".png": "app-icon.png", | |
| } | |
| def app_icon_bytes(suffix: str) -> bytes: | |
| """Read the packaged app icon matching a native file suffix.""" | |
| normalized_suffix = suffix.lower() | |
| try: | |
| filename = _ICON_FILES[normalized_suffix] | |
| except KeyError as exc: | |
| supported = ", ".join(sorted(_ICON_FILES)) | |
| raise ValueError( | |
| f"Unsupported app icon format {suffix!r}; expected one of: {supported}" | |
| ) from exc | |
| return files("free_claude_code").joinpath("assets", filename).read_bytes() | |
| def export_app_icon(destination: Path) -> None: | |
| """Copy the packaged native icon to an installer-owned destination.""" | |
| destination.parent.mkdir(parents=True, exist_ok=True) | |
| destination.write_bytes(app_icon_bytes(destination.suffix)) | |