from __future__ import annotations


class ClipboardHelper:
    def __init__(self) -> None:
        self._fallback = ''

    def copy(self, text: str) -> bool:
        self._fallback = text
        try:
            import pyperclip  # type: ignore
            pyperclip.copy(text)
            return True
        except Exception:
            return False

    def paste(self) -> str:
        try:
            import pyperclip  # type: ignore
            return str(pyperclip.paste())
        except Exception:
            return self._fallback
