Files
rclone-jav/rc-jav.py
T
admin 1cc2c38128 Step 10i: rc-jav.py becomes a thin shim; main() lives in rcjav/cli.py
The real entrypoint moved into rcjav/cli.py (845 lines: imports + the
remaining top-level glue + collectors + main()). rc-jav.py is now a
25-line shim that does:

  - `from rcjav import *` to re-export the package surface for callers
    that load this script via importlib.spec_from_file_location
    (tests/test_rules.py, fixtures/run.py, the native-messaging host
    via importlib).
  - `from rcjav.cli import main` and call it under `__main__`.

Verified all four entry points:
  - python rc-jav.py --help              → ok (legacy CLI invocation)
  - python -m rcjav.cli --help           → ok (package-direct)
  - 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 22:01:52 +02:00

26 lines
910 B
Python

#!/usr/bin/env python3
"""Scan rclone remotes for duplicate JAV files grouped by ID.
This file is a thin shim. All implementation lives in the `rcjav`
package; `rcjav.cli.main` is the real entrypoint. Names that
external consumers (tests, fixtures runner, native-messaging host)
historically imported from this script remain available via the
wildcard re-export from `rcjav/__init__.py`.
"""
from __future__ import annotations
import sys
# Re-export the public surface so `importlib.spec_from_file_location("rcjav_script", "rc-jav.py")`
# style loaders still find FileEntry, extract_id, decide_keep_with_reason, etc. via attribute access.
from rcjav import * # noqa: F401,F403
from rcjav.cli import main
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
sys.stderr.write("\nAborted by user (Ctrl+C). Cache not written for in-flight scans.\n")
sys.exit(130)