INNER CODE UNIT · Python

_pixels_required

wiltodelta/remove-ai-watermarks · src/remove_ai_watermarks/cli.py:389

def _pixels_required(func: Callable[..., None]) -> Callable[..., None]:
    """Report a missing pixel stack as an install hint instead of a traceback.

    The default package installs WITHOUT ``pixels``, and the Homebrew formula ships
    exactly that build, so a first run that followed this project's own install
    instructions died mid-command on a bare ``ModuleNotFoundError: No module named
    'cv2'`` -- the one moment the user needed the extra named, and the only moment
    they were not told it. ``identify`` and ``metadata`` still answer without the
    stack, so the guard goes on the commands that cannot, not on the group. The video
    commands are NOT in that set on purpose: ``video._require_video_runtime`` already
    stops them and names the ``video`` extra, which is the one that actually makes
    them work -- wrapping them here would answer with ``visible`` instead.

    Applied innermost, below the click decorators, so the wrapper is what carries
    the options and what click invokes.
    """

    @functools.wraps(func)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…