Skip to content

Commit

Permalink
feat : winapp runs in any cases
Browse files Browse the repository at this point in the history
  • Loading branch information
manatlan authored Nov 1, 2023
1 parent a106a47 commit 7faab3b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions htag/runners/winapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,20 @@ async def on_message(this, data):
await _sendactions( this, actions )

def on_close(this):
print("!!! exit on socket.close !!!")
self.chromeapp.exit()
os._exit(0)

self.chromeapp = _ChromeApp(f"http://{host}:{port}",size=size)
try:
self.chromeapp = _ChromeApp(f"http://{host}:{port}",size=size)
except:
import webbrowser
webbrowser.open_new_tab(f"http://{host}:{port}")
class FakeChromeApp:
def wait(self,thread):
pass
def exit(self):
pass
self.chromeapp = FakeChromeApp()
app = tornado.web.Application([(r"/", MainHandler),(r"/ws", SocketHandler)])
app.listen(port)
tornado.ioloop.IOLoop.current().start()

0 comments on commit 7faab3b

Please sign in to comment.