How to use the pyvirtualdisplay.xephyr.XephyrDisplay function in PyVirtualDisplay

To help you get started, we’ve selected a few PyVirtualDisplay 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 ponty / PyVirtualDisplay / tests / test_core.py View on Github external
def test_repr_xephyr():
    display = Display(visible=True)
    print(repr(display))

    display = Display(backend="xephyr")
    print(repr(display))

    display = XephyrDisplay()
    print(repr(display))
github ponty / PyVirtualDisplay / tests / test_core.py View on Github external
#     assert not d._is_started
    #     d.start()
    #     assert d._is_started
    #     d.stop()
    #     assert d._is_started

    # with Display() as d:
    #     assert d._is_started
    # assert d._is_started

    with XvfbDisplay() as d:
        assert d._is_started
    assert d._is_started

    with Display():
        with XephyrDisplay() as d:
            assert d._is_started
        assert d._is_started
github ponty / PyVirtualDisplay / tests / test_core.py View on Github external
def test_extra_args():
    # Unrecognized option
    d = Display(extra_args=["willcrash"])
    with pytest.raises(XStartError):
        d.start()

    with Display():
        # -c                     turns off key-click
        with Display(visible=True, extra_args=["-c"]) as d:
            assert d.is_alive()
        assert not d.is_alive()

        with XephyrDisplay(extra_args=["-c"]) as d:
            assert d.is_alive()
        assert not d.is_alive()
github ponty / PyVirtualDisplay / pyvirtualdisplay / display.py View on Github external
from pyvirtualdisplay.xephyr import XephyrDisplay
from pyvirtualdisplay.xvfb import XvfbDisplay
from pyvirtualdisplay.xvnc import XvncDisplay

_class_map = {"xvfb": XvfbDisplay, "xvnc": XvncDisplay, "xephyr": XephyrDisplay}


class Display(object):
    """
    Proxy class

    :param color_depth: [8, 16, 24, 32]
    :param size: screen size (width,height)
    :param bgcolor: background color ['black' or 'white']
    :param visible: True -> Xephyr, False -> Xvfb
    :param backend: 'xvfb', 'xvnc' or 'xephyr', ignores ``visible``
    :param xauth: If a Xauthority file should be created.
    """

    def __init__(
        self,