How to use the pyvirtualdisplay.xvnc.XvncDisplay 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_xvnc.py View on Github external
def test_color_xvnc():
        with tempfile.TemporaryDirectory() as temp_dir:
            vnc_png = Path(temp_dir) / "vnc.png"
            password = "123456"
            passwd_file = Path(temp_dir) / "pwd.txt"
            vncpasswd_generated = b"\x49\x40\x15\xf9\xa3\x5e\x8b\x22"
            passwd_file.write_bytes(vncpasswd_generated)

            with Display(backend="xvnc"):
                with api.connect("localhost:0") as client:
                    client.timeout = 1
                    client.captureScreen(vnc_png)
            with XvncDisplay():
                with api.connect("localhost:0") as client:
                    client.timeout = 1
                    client.captureScreen(vnc_png)

            with Display(backend="xvnc", rfbport=5900 + 9876):
                with api.connect("localhost:9876") as client:
                    client.timeout = 1
                    client.captureScreen(vnc_png)
            with XvncDisplay(rfbport=5900 + 9876):
                with api.connect("localhost:9876") as client:
                    client.timeout = 1
                    client.captureScreen(vnc_png)

            with Display(backend="xvnc", rfbauth=passwd_file):
                with api.connect("localhost:0", password=password) as client:
                    client.timeout = 1
github ponty / PyVirtualDisplay / tests / test_xvnc.py View on Github external
client.captureScreen(vnc_png)

            with Display(backend="xvnc", rfbport=5900 + 9876):
                with api.connect("localhost:9876") as client:
                    client.timeout = 1
                    client.captureScreen(vnc_png)
            with XvncDisplay(rfbport=5900 + 9876):
                with api.connect("localhost:9876") as client:
                    client.timeout = 1
                    client.captureScreen(vnc_png)

            with Display(backend="xvnc", rfbauth=passwd_file):
                with api.connect("localhost:0", password=password) as client:
                    client.timeout = 1
                    client.captureScreen(vnc_png)
            with XvncDisplay(rfbauth=passwd_file):
                with api.connect("localhost:0", password=password) as client:
                    client.timeout = 1
                    client.captureScreen(vnc_png)
github ponty / PyVirtualDisplay / tests / test_core.py View on Github external
def test_repr_xvnc():
        display = Display(backend="xvnc")
        print(repr(display))

        display = XvncDisplay()
        print(repr(display))
github ponty / PyVirtualDisplay / tests / test_xvnc.py View on Github external
passwd_file.write_bytes(vncpasswd_generated)

            with Display(backend="xvnc"):
                with api.connect("localhost:0") as client:
                    client.timeout = 1
                    client.captureScreen(vnc_png)
            with XvncDisplay():
                with api.connect("localhost:0") as client:
                    client.timeout = 1
                    client.captureScreen(vnc_png)

            with Display(backend="xvnc", rfbport=5900 + 9876):
                with api.connect("localhost:9876") as client:
                    client.timeout = 1
                    client.captureScreen(vnc_png)
            with XvncDisplay(rfbport=5900 + 9876):
                with api.connect("localhost:9876") as client:
                    client.timeout = 1
                    client.captureScreen(vnc_png)

            with Display(backend="xvnc", rfbauth=passwd_file):
                with api.connect("localhost:0", password=password) as client:
                    client.timeout = 1
                    client.captureScreen(vnc_png)
            with XvncDisplay(rfbauth=passwd_file):
                with api.connect("localhost:0", password=password) as client:
                    client.timeout = 1
                    client.captureScreen(vnc_png)