@@ -116,16 +116,18 @@ def check_whitelist(email):
116116
117117current_dir = Path (__file__ ).parent .resolve ()
118118assets_dir = current_dir .parent / "assets" / "icons"
119+ update_dir = current_dir .parent / "updates"
119120
120121ico16 = Image .open (assets_dir / "FileLauncher16.ico" )
121122ico32 = Image .open (assets_dir / "FileLauncher32.ico" )
122123ico48 = 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"
126127prompt_icon_image = Image .open (icon_path )
127128photo = ImageTk .PhotoImage (prompt_icon_image )
128129fl .wm_iconphoto (False , photo )
130+ root .wm_iconphoto (False , photo )
129131
130132print ("[FileLauncher" + app_version + "]: " + "Master FileLauncher.ico created!" )
131133
@@ -189,7 +191,7 @@ title_bar.bind("<ButtonRelease-1>", stop_move)
189191title_bar .bind ("<B1-Motion>" , moving )
190192
191193assets_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"
193195img_open = Image .open (icon_path_16 )
194196header_icon = ImageTk .PhotoImage (img_open )
195197icon_label = tk .Label (title_bar , image = header_icon , bg = TITLE_BLUE )
@@ -531,73 +533,30 @@ def open_github():
531533github_icon_path = str (assets_dir / "photos" / "github_icon.png" )
532534more_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 )
535537more_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:
603562more_update_button = tk .Button (more , command = py_package_update , text = "Update Python Packages" , cursor = "hand2" , font = WIN95_FONT , background = WIN95_GRAY )
0 commit comments