How to use the pyperclip.HAS_DISPLAY function in pyperclip

To help you get started, we’ve selected a few pyperclip examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github asweigart / pyperclip / tests / test_pyperclip.py View on Github external
else:
            clipboard = init_osx_pyobjc_clipboard()


class TestGtk(_TestClipboard):
    if HAS_DISPLAY:
        try:
            import gtk
        except ImportError:
            pass
        else:
            clipboard = init_gtk_clipboard()


class TestQt(_TestClipboard):
    if HAS_DISPLAY:
        try:
            import PyQt5
        except ImportError:
            try:
                import PyQt4
            except ImportError:
                pass
            else:
                clipboard = init_qt_clipboard()
        else:
            clipboard = init_qt_clipboard()


class TestXClip(_TestClipboard):
    if _executable_exists("xclip"):
        clipboard = init_xclip_clipboard()