From d8c9d20e2cbbf36768a33e13a345bde2e3ddf10f Mon Sep 17 00:00:00 2001 From: Taka Date: Tue, 15 Mar 2022 09:44:23 +1100 Subject: [PATCH] Added some comments. --- vasl_templates/webapp/vassal.py | 6 ++++++ vasl_templates/webapp/webdriver.py | 3 +++ 2 files changed, 9 insertions(+) diff --git a/vasl_templates/webapp/vassal.py b/vasl_templates/webapp/vassal.py index 9d35ede..31f482d 100644 --- a/vasl_templates/webapp/vassal.py +++ b/vasl_templates/webapp/vassal.py @@ -391,6 +391,12 @@ class VassalShim: def _run_vassal_shim( self, *args ): #pylint: disable=too-many-locals """Run the VASSAL shim.""" + # NOTE: If VASSAL is taking a really long time to run (when it's loading the VASL module), + # check if any NIC's are enabled, but there isn't actually any internet access. I suspect + # that VASL is checking for something online, and taking a really long time to time-out. + # If there are no NIC's, then the attempt to connect fails immediately, but there are, + # the networking stack tries to find a route online. + # initialize logger = logging.getLogger( "vassal_shim" ) diff --git a/vasl_templates/webapp/webdriver.py b/vasl_templates/webapp/webdriver.py index 39ab7fe..03856a8 100644 --- a/vasl_templates/webapp/webdriver.py +++ b/vasl_templates/webapp/webdriver.py @@ -118,6 +118,9 @@ class WebDriver: def get_screenshot( self, html, window_size, large_window_size=None ): """Get a preview screenshot of the specified HTML.""" + # NOTE: If this is taking a really long time to run, check if there are images + # being downloaded from the internet, but no internet access... :-/ + def do_get_screenshot(): #pylint: disable=missing-docstring data = self.driver.get_screenshot_as_png() img = Image.open( io.BytesIO( data ) )