From ab333907362a506880b03c46db3640f02be86e06 Mon Sep 17 00:00:00 2001 From: Domhnall Morrissey Date: Mon, 19 Sep 2022 11:35:56 +0100 Subject: [PATCH] V0.33.9 Added error handling to open with command --- src/__pycache__/branch_tab.cpython-39.pyc | Bin 25350 -> 25574 bytes src/branch_tab.py | 10 ++++++++-- src/main.py | 2 +- src/tk_path_finder_config.json | 3 +++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/__pycache__/branch_tab.cpython-39.pyc b/src/__pycache__/branch_tab.cpython-39.pyc index 7be198e0abe23cfba4985b513cf92a6f7b0cf464..5e6e1f0c7cdd890b033cac0d48d530d6fdf6d111 100644 GIT binary patch delta 922 zcmZ8fU1$_n6u#fg>}Ge9U6VB`Awk!GBwH{hB&|*2Pkx$2+{8rOB~gg7*_n+g>rA*# zHfG(_f~9X#(oP zztZi{zhkp#=FA}xFFSLfP@PHJw&TXKQ??m%k6Rq%tU@r!QF?khR$r*9kNroP;G#2Q zo3d3I-K;2CCzo?(r|ij?C8Z-{P9`%WEi)8~$u=g%{qh43@@s}tu@iAD@IzF{FxX z62B^yDG1PHdwqL_3I`Px*^)LpaU@_mnVA!o?Ml8WA%hCGEBP8UsYq>`_kL_o0*`1z z=M((qt#;NJh?1|X8-fP9zOPvmf24cCx~JZ|u1a7%={?KXWfrQc>Eyu-$Y%hbttEi)Y-Cf)v6Xjzb0xi zipw4lTK+2MwSt3p=Ma-SeUPr8qM)BHA66w{u^HcMMKx@xdrsA-R5<0X;7QO2uAd7eHzd@wMI=`=5mfMmiQ-*D{c~-6rWLW zQ$g+@$W!bmLn}0GKxd-KlUrv2zsxWEY=R-3JCd+nL2WhgvBl{$Krb>%1#qp)KB1W{cW#fkw0LbVTHH??qso1`aN8oC;qB zi_Z9pFiE$4M^mjV4gc+D&oIowD(hONO?X0I4^3i$M*Rmk;u}9d4;pJL#TA-w`+*no fZaW{zYx>mDj~VF;q#;2C6;>Jw_Qu;CdmOIczIwi4 diff --git a/src/branch_tab.py b/src/branch_tab.py index 05809a0..b216fa6 100644 --- a/src/branch_tab.py +++ b/src/branch_tab.py @@ -345,8 +345,14 @@ def open_in_text_editor(self, app=None): messagebox.showerror('Error', message='Default Text Editor has not been Defined') def open_with_app(self, app, file): - subprocess.call([app, file]) - + try: + subprocess.call([app, file]) + except Exception as e: + msg = str(e) + if "cannot find the file" in msg: + msg = f'The app "{app}" cannot be found' + messagebox.showerror('Error', message=f"The following error occured\n\n {msg}") + def new_folders(self): self.w=AddFoldersWindow(self.mainapp, self.master, self) self.master.wait_window(self.w.top) diff --git a/src/main.py b/src/main.py index 503725f..aa27709 100644 --- a/src/main.py +++ b/src/main.py @@ -49,7 +49,7 @@ def __init__(self, parent, *args, **kwargs): self.switch_style("darkly") def setup_variables(self): - self.version = "0.33.8" + self.version = "0.33.9" self.parent.title(f"Tk Path Finder V{self.version}") self.config_data = config_file_manager.load_config_file(self) self.plugin_folder = ".\Plugins" diff --git a/src/tk_path_finder_config.json b/src/tk_path_finder_config.json index f50bc08..68c57e5 100644 --- a/src/tk_path_finder_config.json +++ b/src/tk_path_finder_config.json @@ -38,6 +38,9 @@ "open_with_apps": { ".py": [ "C:\\Program Files\\Sublime Text 3\\sublime_text.exe" + ], + ".json": [ + "fdgdfgdg" ] }, "default_file_width": 600,