add start_browser.py, starting chrome after websocket is ready
This commit is contained in:
17
start_browser.py
Normal file
17
start_browser.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import os
|
||||
import time
|
||||
import socket
|
||||
|
||||
show = True
|
||||
for _ in range(30):
|
||||
try:
|
||||
socket.create_connection(('localhost', 8010), timeout=1)
|
||||
os.system('/usr/bin/chromium-browser http://localhost:8080/')
|
||||
break
|
||||
except Exception as e:
|
||||
time.sleep(1)
|
||||
if show:
|
||||
print('waiting for frappy websocket')
|
||||
show = False
|
||||
else:
|
||||
print('do not start chrome - waiting for frappy websocket failed')
|
||||
Reference in New Issue
Block a user