Apply suggestions from code review

Co-Authored-By: jstafford <jason.stafford@scrycollective.com>
This commit is contained in:
Michael Droettboom 2019-02-07 13:15:40 -08:00 committed by GitHub
parent 770cca23c0
commit 89fcd32a20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -143,7 +143,7 @@ class SeleniumWrapper:
catch (error) {{ console.log(error.stack); throw error; }}"""
return self.driver.execute_script(catch)
def initWebWorker(self):
def setup_webworker(self):
hostname = self.server_hostname
port = self.server_port
url = f'http://{hostname}:{port}/webworker_dev.js'
@ -173,7 +173,7 @@ class SeleniumWrapper:
def run_webworker(self, code):
from selenium.common.exceptions import TimeoutException
self.initWebWorker()
self.setup_webworker()
if isinstance(code, str) and code.startswith('\n'):
# we have a multiline string, fix indentation
code = textwrap.dedent(code)