Skip to content

Commit

Permalink
WT stays open regardless, don't use input()
Browse files Browse the repository at this point in the history
  • Loading branch information
chloecormier committed Jun 9, 2022
1 parent bff5fa8 commit e5a85af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 6 additions & 3 deletions TF2CDownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import gui
import setup
import install

# PyInstaller offers no native way to select which application you use for the console.
# Instead, it uses the system default, which is cmd.exe at time of writing.
# This hack checks if Windows Terminal is installed. If it is, and if the application
Expand Down Expand Up @@ -37,8 +36,12 @@ def sanity_check():
except:
traceback.print_exc()
print("[italic magenta]----- Exception details above this line -----")
print("[bold red]The program has failed. Post a screenshot in #technical-issues on the Discord.[/bold red]")
input("Press Enter to exit.")
print("[bold red]:warning: The program has failed. Post a screenshot in #technical-issues on the Discord. :warning:[/bold red]")
if os.environ.get("WT_SESSION"):
print("[bold]You are safe to close this window.")
else:
input("Press Enter to exit.")
exit(1)


gui.message_end("The installation has successfully completed. Remember to restart Steam!", 0)
7 changes: 5 additions & 2 deletions gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from sys import exit
from platform import system
from rich import print
import os
import sys

def message(msg: str, delay = 0):
Expand Down Expand Up @@ -64,6 +65,8 @@ def message_end(msg, code):
Show a message and exit.
"""
print("[bold green]" + msg)
if system() == 'Windows':
input('Press Enter to exit.')
if os.environ.get("WT_SESSION"):
print("[bold]You are safe to close this window.")
else:
input("Press Enter to exit.")
exit(code)

0 comments on commit e5a85af

Please sign in to comment.