-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathcli.py
More file actions
32 lines (24 loc) · 894 Bytes
/
Copy pathcli.py
File metadata and controls
32 lines (24 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import argparse
import subprocess
import sys
from get_path import APP_NAME
def update_package():
command = [sys.executable, "-m", "pip", "install", "--upgrade", APP_NAME]
try:
subprocess.check_call(command)
print("CustomTkinterBuilder updated successfully.")
return 0
except subprocess.CalledProcessError as error:
print(f"Update failed (exit code {error.returncode}). Please run the command manually:")
print(" ".join(command))
return error.returncode
def main():
parser = argparse.ArgumentParser(prog="customtkinterbuilder")
parser.add_argument("--update", action="store_true", help="Update CustomTkinterBuilder to the latest version")
args = parser.parse_args()
if args.update:
raise SystemExit(update_package())
from WelcomePage import launch
launch()
if __name__ == "__main__":
main()