How to use the pyvirtualdisplay.display.Display 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 / EasyProcess / tests / test_fast / test_deadlock.py View on Github external
def test_deadlock():
    # skip these tests for Windows/Mac
    if not sys.platform.startswith("linux"):
        return
    d = Display(visible=VISIBLE, size=(600, 400))
    d.start()

    p = EasyProcess([python, "-c", 'import Image;Image.new("RGB",(99, 99)).show()'])
    p.start()
    p.sleep(1)
    # hangs with pipes
    p.stop()

    d.stop()
github dimkouv / protonmail-cli / protonmail / core.py View on Github external
def __init__(self):
        utilities.log("Initiating ProtonMail client")

        try:
            if not settings.show_browser:
                self.virtual_display = Display(visible=0, size=(1366, 768))
                self.virtual_display.start()

            self.web_driver = webdriver.Firefox()

            atexit.register(self.destroy)
        except Exception as e:
            utilities.log(
                "Unable to initiate Protonmail Client. Reason: " + str(e))