Skip to content

Commit 299c0d0

Browse files
committed
Dev 05.15.26.15.21
1 parent d0b4134 commit 299c0d0

4 files changed

Lines changed: 23 additions & 61 deletions

File tree

‎src/assets/icons/FileLauncher.ico‎

1.91 KB
Binary file not shown.
162 Bytes
Binary file not shown.

‎src/gui/gui.pyw‎

Lines changed: 20 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,18 @@ def check_whitelist(email):
116116

117117
current_dir = Path(__file__).parent.resolve()
118118
assets_dir = current_dir.parent / "assets" / "icons"
119+
update_dir = current_dir.parent / "updates"
119120

120121
ico16 = Image.open(assets_dir / "FileLauncher16.ico")
121122
ico32 = Image.open(assets_dir / "FileLauncher32.ico")
122123
ico48 = Image.open(assets_dir / "FileLauncher48.ico")
123124
# ico256 = Image.open(assets_dir / "FileLauncher256.ico")
124125
# ico256.save(assets_dir / "FileLauncher256.ico", format="ICO", append_images=[ico256, ico48, ico32, ico16])
125-
icon_path = Path(__file__).parent.parent.parent / "src" / "assets" / "icons" / "FileLauncher.ico"
126+
icon_path = Path(__file__).parent.parent.parent / "src" / "gui" / "FileLauncher.ico"
126127
prompt_icon_image = Image.open(icon_path)
127128
photo = ImageTk.PhotoImage(prompt_icon_image)
128129
fl.wm_iconphoto(False, photo)
130+
root.wm_iconphoto(False, photo)
129131

130132
print("[FileLauncher" + app_version + "]: " + "Master FileLauncher.ico created!")
131133

@@ -189,7 +191,7 @@ title_bar.bind("<ButtonRelease-1>", stop_move)
189191
title_bar.bind("<B1-Motion>", moving)
190192

191193
assets_dir = Path(__file__).parent.resolve().parent / "assets"
192-
icon_path_16 = assets_dir / "icons" / "FileLauncher16.ico"
194+
icon_path_16 = assets_dir / "icons" / "FileLauncher32.ico"
193195
img_open = Image.open(icon_path_16)
194196
header_icon = ImageTk.PhotoImage(img_open)
195197
icon_label = tk.Label(title_bar, image=header_icon, bg=TITLE_BLUE)
@@ -531,73 +533,30 @@ def open_github():
531533
github_icon_path = str(assets_dir / "photos" / "github_icon.png")
532534
more_gh_icon = tk.PhotoImage(file=github_icon_path, format="PNG", width=64, height=64)
533535

534-
more_link_button = tk.Button(more, image=str(more_gh_icon), command=open_github, cursor="hand2", borderwidth=0, highlightthickness=0)
536+
more_link_button = tk.Button(more, image=str(more_gh_icon), command=open_github, cursor="hand2", borderwidth=0, highlightthickness=0, background=WIN95_GRAY, highlightcolor=WIN95_GRAY)
535537
more_link_button.pack(pady=10, padx=20, anchor="w")
536538

537539
# Python Packages Update Function:
538540

539-
python_exe = ""
540-
541-
def py_package_update():
542-
requests_command = " -m pip install requests"
543-
requests_results = subprocess.Popen([python_exe, str(requests_command)], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, bufsize=1)
544-
for line in requests_results.stdout:
545-
print(line, end='', flush=True)
546-
547-
return_code = str(requests_results.wait())
548-
if return_code != 0:
549-
print(f"\n" + app_version + "Updating failed with: " + return_code)
550-
551-
552-
psutil_command = " -m pip install --upgrade psutil"
553-
psutil_results = subprocess.Popen([python_exe, str(psutil_command)], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, bufsize=1)
554-
for line in psutil_results.stdout:
555-
print(line, end='', flush=True)
556-
557-
return_code = str(psutil_results.wait())
558-
if return_code != 0:
559-
print(f"\n" + app_version + "Updating failed with: " + return_code)
560-
561-
pillow_command = " -m pip install --upgrade PIL"
562-
pillow_results = subprocess.Popen([python_exe, str(pillow_command)], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, bufsize=1)
563-
for line in pillow_results.stdout:
564-
print(line, end='', flush=True)
565-
566-
return_code = str(pillow_results.wait())
567-
if return_code !=0:
568-
print(f"\n" + app_version + "Updating failed with: " + return_code)
541+
more_pbar = ttk.Progressbar(more, mode="indeterminate", length=200)
542+
more_pbar.pack(pady=10, padx=20, fill="x")
569543

570-
571-
google_auth_oauthlib_command = " -m pip install --upgrade google-auth-oauthlib"
572-
google_auth_oauthlib_results = subprocess.Popen([python_exe, str(google_auth_oauthlib_command)], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, bufsize=1)
573-
for line in google_auth_oauthlib_results.stdout:
574-
print(line, end='', flush=True)
575-
576-
return_code = str(google_auth_oauthlib_results.wait())
577-
if return_code != 0:
578-
print(f"\n" + app_version + "Updating failed with: " + return_code)
579-
580-
581-
google_auth_httplib2_command = " -m pip install --upgrade google-auth-httplib2"
582-
google_auth_httplib2_results = subprocess.Popen([python_exe, str(google_auth_httplib2_command)], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, bufsize=1)
583-
for line in google_auth_httplib2_results.stdout:
584-
print(line, end='', flush=True)
585-
586-
return_code = str(google_auth_httplib2_results.wait())
587-
if return_code != 0:
588-
print(f"\n" + app_version + "Updating failed with: " + return_code)
589-
590-
google_api_python_client_command = " -m pip install --upgrade google-api-python-client"
591-
google_api_python_client_results = subprocess.Popen([python_exe, str(google_api_python_client_command)], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, bufsize=1)
592-
for line in google_api_python_client_results.stdout:
593-
print(line, end='', flush=True)
594-
595-
return_code = str(google_auth_oauthlib_results.wait())
596-
if return_code != 0:
597-
print(f"\n" + app_version + "Updating failed with: " + return_code)
544+
more_pbar_label = tk.Label(more, background=WIN95_GRAY)
545+
more_pbar_label.pack(pady=10, padx=20, fill="x")
598546

599547

600548

549+
def py_package_update():
550+
psfile = update_dir / "update_libs.ps1"
551+
print(psfile)
552+
more_pbar.start(10)
553+
proc = subprocess.Popen(["powershell.exe", psfile], stdout=subprocess.PIPE)
554+
proc.wait()
555+
more.after(0, task_finished)
556+
557+
def task_finished():
558+
proc.stop()
559+
more_pbar.config(text="Libraries Updated")
601560

602561
# Update Button:
603562
more_update_button = tk.Button(more, command=py_package_update, text="Update Python Packages", cursor="hand2", font=WIN95_FONT, background=WIN95_GRAY)

‎src/updates/update_libs.ps1‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
cd ..
2+
cd ..
3+
14
./.venv/scripts/python.exe -m pip install --upgrade pip
25

36
./.venv/scripts/python.exe -m pip install --upgrade requests

0 commit comments

Comments
 (0)