"""Retired duplicate MicroPython LVGL launcher.

The production touchscreen is owned by :mod:`main.lvgl_frontend` and its
system service.  Keeping this module as a fail-closed shim prevents stale
launch commands from starting a second display loop.
"""

from __future__ import annotations

LEGACY_MP_MAIN_SCREEN_DISABLED_MESSAGE = (
    "Legacy MicroPython main screen is retired: use main.lvgl_frontend with "
    "the labcobot-lvgl system service"
)


class LegacyMPMainScreenDisabledError(RuntimeError):
    """Raised before the retired launcher can initialize LVGL."""


def _disabled(*_args, **_kwargs):
    raise LegacyMPMainScreenDisabledError(LEGACY_MP_MAIN_SCREEN_DISABLED_MESSAGE)


def create_main_screen():
    """Reject creation of the obsolete duplicate screen."""

    _disabled()


def main() -> None:
    """Reject direct launch without importing or initializing LVGL."""

    _disabled()


if __name__ == "__main__":  # pragma: no cover - exercised by launchers
    main()
