Skip to content

Commit

Permalink
#510 Show informative text in terminal when starting application
Browse files Browse the repository at this point in the history
  • Loading branch information
brentvollebregt committed Dec 2, 2024
1 parent 3059fd5 commit ca62149
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion auto_py_to_exe/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,29 @@ def start(open_mode):
edge_available = __can_use_edge()

if open_mode == config.UIOpenMode.CHROME_OR_EDGE and chrome_available:
print("The interface is being opened in a new Chrome window")
print(
"Please do not close this terminal while using auto-py-to-exe - the process will end when the window is closed"
)
eel.start("index.html", size=(650, 672), port=0, mode="chrome")
elif open_mode == config.UIOpenMode.CHROME_OR_EDGE and edge_available:
print("The interface is being opened in a new Edge window")
print(
"Please do not close this terminal while using auto-py-to-exe - the process will end when the window is closed"
)
eel.start("index.html", size=(650, 673), port=0, mode="edge")
elif open_mode == config.UIOpenMode.DEFAULT_BROWSER or (
open_mode == config.UIOpenMode.CHROME_OR_EDGE and not chrome_available and not edge_available
):
print("The interface is being opened in your default browser")
print(
"Please do not close this terminal while using auto-py-to-exe - the process will end when the window is closed"
)
eel.start("index.html", size=(650, 672), port=0, mode="user default")
else:
port = utils.get_port()
print("Server starting at http://localhost:" + str(port) + "/index.html")
print(f"Server starting at http://localhost:{port}/index.html")
print("You may end this process using Ctrl+C when finished using auto-py-to-exe")
eel.start("index.html", host="localhost", port=port, mode=None, close_callback=lambda x, y: None)
except (SystemExit, KeyboardInterrupt):
pass # This is what the bottle server raises

0 comments on commit ca62149

Please sign in to comment.