mirror of
https://github.com/got-feedBack/feedBack.git
synced 2026-09-11 04:34:30 +00:00
Phase 1 of deprecating the format name sloppak -> feedpak. Purely additive and fully back-compat: nothing sloppak stops working, and no on-disk/runtime artifacts (cache dir, config, SLOPSMITH_* env) are touched. - lib/sloppak.py: detection accepts both `.feedpak` and `.sloppak` (new PACK_SUFFIXES / is_pack / is_feedpak; is_sloppak kept as a deprecated alias that now matches both). Read the optional top-level `feedpak_version` manifest key onto LoadedSloppak and into extract_meta(). Add LoadedFeedpak class alias and a deprecation note in the module docstring. - lib/feedpak.py (new): canonical module name; re-exports the sloppak public API unchanged so new code can `import feedpak`. - server.py: accept `.feedpak` uploads (_ALLOWED_SONG_EXTS + message); add a `get_feedpak_cache_dir` plugin-context key alongside the legacy `get_sloppak_cache_dir` (same dir); tolerate a `feedpak` value in the library format filter. - static/: accept `.feedpak` in the upload picker (index.html accept=, app.js client-side filter). - tests/test_feedpak_alias.py: both extensions detected + loaded via both module names, feedpak_version read, legacy aliases intact. The emitted `format` library tag stays "sloppak" for both extensions this phase (flipping it to "feedpak" with badge/gating updates is a deliberate frontend-touching follow-up). Format spec: got-feedback/feedback-feedpak-spec. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Kris Anderson <topkoa@gmail.com>
51 lines
1.4 KiB
Python
51 lines
1.4 KiB
Python
"""feedpak — open song-package format loader (canonical module name).
|
|
|
|
The format was renamed `sloppak` → `feedpak`. The implementation currently still
|
|
lives in :mod:`sloppak`; this module is the **canonical name going forward** and
|
|
re-exports that public API unchanged, so new code can do::
|
|
|
|
import feedpak
|
|
loaded = feedpak.load_song(filename, dlc_root, cache_root)
|
|
|
|
Both `.feedpak` and `.sloppak` packs are accepted everywhere (the legacy
|
|
extension and the `sloppak` module name are kept as permanent deprecated
|
|
aliases). The authoritative on-disk format spec is published at
|
|
https://github.com/got-feedback/feedback-feedpak-spec.
|
|
|
|
When the internal rename lands, the implementation can move into this module and
|
|
`sloppak.py` becomes the thin re-export shim instead — importers of `feedpak`
|
|
will not need to change.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from sloppak import ( # noqa: F401 (re-export)
|
|
PACK_SUFFIXES,
|
|
LoadedFeedpak,
|
|
LoadedSloppak,
|
|
extract_meta,
|
|
get_cached_source_dir,
|
|
is_feedpak,
|
|
is_pack,
|
|
is_sloppak,
|
|
load_manifest,
|
|
load_song,
|
|
read_feedpak_version,
|
|
resolve_source_dir,
|
|
)
|
|
|
|
__all__ = [
|
|
"PACK_SUFFIXES",
|
|
"LoadedFeedpak",
|
|
"LoadedSloppak",
|
|
"extract_meta",
|
|
"get_cached_source_dir",
|
|
"is_feedpak",
|
|
"is_pack",
|
|
"is_sloppak",
|
|
"load_manifest",
|
|
"load_song",
|
|
"read_feedpak_version",
|
|
"resolve_source_dir",
|
|
]
|