diff --git a/vasl_templates/webapp/static/help/index.html b/vasl_templates/webapp/static/help/index.html index 071ed65..8351967 100644 --- a/vasl_templates/webapp/static/help/index.html +++ b/vasl_templates/webapp/static/help/index.html @@ -69,12 +69,6 @@ pip install .[gui]

Then, just run the vasl-templates command. -

- - -If you're running from source on Windows, you may see a black DOS box appear temporarily when performing certain actions (e.g. updating a VASL scenario). This is because vasl-templates runs a webdriver as part of its processing, which is a CLI program, and so the DOS box appears. Unfortunately, there's no way to control this in the vasl-templates code, but it can be disabled in the webdriver code itself. In your virtualenv, open the file Lib/site-packages/selenium/webdriver/common/service.py, and in the call to subprocess.Popen(), add a new creationflags = 0x8000000 parameter. -
-

Running just the web server

The simpler option is to just run the web server: @@ -610,10 +604,6 @@ python freeze.py --output c:\temp\vasl-templates.zip The script will compile the program, then package it all up with the necessary support files into a single archive file. -

-If you are creating a Windows release, you should apply the webdriver fix first. -
- diff --git a/vasl_templates/webapp/webdriver.py b/vasl_templates/webapp/webdriver.py index 03856a8..8bce826 100644 --- a/vasl_templates/webapp/webdriver.py +++ b/vasl_templates/webapp/webdriver.py @@ -11,7 +11,7 @@ from selenium import webdriver from PIL import Image from vasl_templates.webapp import app, globvars -from vasl_templates.webapp.utils import TempFile, SimpleError, trim_image +from vasl_templates.webapp.utils import TempFile, SimpleError, trim_image, is_windows _logger = logging.getLogger( "webdriver" ) @@ -58,13 +58,6 @@ class WebDriver: if not webdriver_path: raise SimpleError( "No webdriver has been configured." ) - # NOTE: If we are being run on Windows without a console (e.g. the frozen PyQt desktop app), - # Selenium will launch the webdriver in a visible DOS box :-( There's no way to turn this off, - # but it can be disabled by modifying the Selenium source code. Find the subprocess.Popen() call - # in $/site-packages/selenium/webdriver/common/service.py and add the following parameter: - # creationflags = 0x8000000 # win32process.CREATE_NO_WINDOW - # It's pretty icky to have to do this, but since we're in a virtualenv, it's not too bad... - # create the webdriver _logger.debug( "- Launching webdriver process: %s", webdriver_path ) log_fname = app.config.get( "WEBDRIVER_LOG", @@ -83,6 +76,8 @@ class WebDriver: service = webdriver.chrome.service.Service( webdriver_path, log_path=log_fname ) + if is_windows(): + service.creationflags = 0x8000000 # win32process.CREATE_NO_WINDOW self.driver = webdriver.Chrome( options=options, service=service ) @@ -92,6 +87,8 @@ class WebDriver: service = webdriver.firefox.service.Service( webdriver_path, log_path=log_fname ) + if is_windows(): + service.creationflags = 0x8000000 # win32process.CREATE_NO_WINDOW self.driver = webdriver.Firefox( options=options, proxy=None, service=service )