Files
rclone-jav/rcjav/__init__.py
T
admin f03d032336 Step 10c: extract cache I/O into rcjav/cache.py
Pulls CACHE_PATH, CACHE_VERSION, CACHE_STALE_HOURS, load_cache,
save_cache, cache_age_hours, and fmt_age out of rc-jav.py and into a
new self-contained module. No behavior change.

rc-jav.py: 2019 → 1972 lines.

The new module's `CACHE_PATH = Path(__file__).resolve().parents[1] /
"cache.json"` keeps the file at the repo root next to rc-jav.py (one
directory above the package), matching the legacy `Path(__file__).
resolve().parent / "cache.json"` location.

rcjav/__init__.py now re-exports the cache public surface alongside
the model and ids surface.

Verified:
  - python rc-jav.py --help              → ok
  - python fixtures/run.py               → 17/17 cases pass
  - python -m unittest tests.test_rules  → 5/5 OK

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 21:46:20 +02:00

34 lines
828 B
Python

"""rcjav — internal package split out of rc-jav.py.
This file re-exports the names that external callers (tests, fixtures
runner, native messaging host, in-tree code in rc-jav.py) expect to
find at the top level. Adding a new submodule does not change the
public surface — only this file does.
"""
from rcjav.model import FileEntry # noqa: F401
from rcjav.cache import ( # noqa: F401
CACHE_PATH,
CACHE_VERSION,
CACHE_STALE_HOURS,
load_cache,
save_cache,
cache_age_hours,
fmt_age,
)
from rcjav.ids import ( # noqa: F401
PRIMARY_ID_RE,
FALLBACK_ID_RE,
COMPOUND_ID_RE,
RANGE_RE,
BUILTIN_PART_RES,
PART_RES,
configure_part_patterns,
detect_part,
detect_part_from_stem,
part_key,
extract_id,
normalize_id,
describe_id_match,
expand_range,
)