From 09bd11522bda22d39276f496fff98a412f8294ef Mon Sep 17 00:00:00 2001 From: Domhnall Morrissey Date: Sun, 31 Jul 2022 11:39:14 +0100 Subject: [PATCH] V0.33.0 Renaming of folders is now enabled --- src/__pycache__/branch_tab.cpython-39.pyc | Bin 25088 -> 25334 bytes src/branch_tab.py | 30 ++++++++++++++-------- src/main.py | 2 +- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/__pycache__/branch_tab.cpython-39.pyc b/src/__pycache__/branch_tab.cpython-39.pyc index 38f712251eb5e061121813417877800cf718f700..3048224375e21c6ac31663d987e8dd6880f7c249 100644 GIT binary patch delta 3770 zcma)83viTI75?wP&ulgi@_z3oAt9SrlaLpogf1j$sE`Db5*`g<$^8SngiU&PLqle_ zv{Fa3WlTL-tG0DPooc5YtvfzOaSAQ1(^5dD)ym4WfQZx?Dj-zEDxP!y@SM!lWcK^d zx#!$-&%Ni|bM9jY*{5%^L{CD3O~Jp`wP!a}jK7*VkrQ7MvJ9(VR)!fbg{N}{*&Mi- z`$N%@>RWixk%-y@sdfV&Z`Qc|Cfn*sZcd(c;o_we?*b6qy8v2-*maAh;}|oah%2 zVis>;aM(Md={kR<@pA+bsBKSWhvB4BQ|wCE2ib7}7fs-9*0 zqid@Fsj};^qSnQ(La6qz`R}BB9J=dz9T$nbMDP!S%LG>lW)mET19fBUIMmJU-flN2 zN{Df`Sq&uPSKX|NtdJT~1{Hq}@&@EfxiPHz?Z}ystK;Uds?QMjaZA|XH*#y(5M&|6 zhx2@fkjmpi25#GBLMuiZi6G@O`pkP6rV3FO9=}WvaoiY5-lOm&lwIP<$eXw_u1qmpK=CC+ zW`&G<7>(jcbuh)3%4eZQip)&Rz7Pu;c`9*J%s;Gqftrs6)8#sLvf)ca8!AuRp?)nV zYz~$Kb@=&#zk_VqQSNOi$*1wJEd-Wf+^uRrc7?)>A}2E+zuAW z-=l0*rc_bMGr}f+BhS2RybtZ;fuTkh&q56&&qhq-IlA6=l;_p3>COY`N3Ss$ag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z$L~<~IwaIT?oP(VsB!u|M6UNohx2u*E}llqo#KBAEl);2tRFF$Qc0ZxT}!%5!v7-d zUz%C;9EB1$oPt!$JlY%FHaytJ$vS4#_~1?-HaD6_y@OUK#g z(ACsZbBAocK!_#uk8B_9<-Un4^h;6{OjF8VP+^1jnqHW`lsV|)gvhcWn+3_sbL4ae z2bQ{70UT>eWq6L3f6q>L{AQD9c*oYk0KX22&B<`mn`Hbgie0dzxs;h9&^!?THdSz% z;0j!7&aApkN8;;ad~N3cHrBQowGXh1ux;{Lr(*Z0~=5yZ+Hi4xnkl&B^G@!RDU zieMr37PN1e$2#DV4Qf*}30e?TvwjSPtr&oN4i)73zeZsIu5P%(s^D)MbJ|Aq2_PB8S0`=_A)Rt-(7qpnzjigXPd6GP6zu1RV265dbtQ%^&8yme8a5WWngP@AouM>QOU=(4moKwg%i0dJE_^6x$%a+O%F)9zA zlK3|#r=$UXzQw)p{`tt#=i?exHr;%PO%X?3bh7E0p6opF8k|Rum}4j~vMV6&SZ{F8 zDE?M;Qy>i*dy?1yZ0yO~*GVhtBc}$dEf9; z*Yw;d(ogyNW_)nPitmM{fckSztDHKO6VJKm<#g$2?%sW-x4Lb*$)s8yGMTiGFW#F> zTe(Hy*Wf^JU8WnIW2UifJA#A5oSt(1)xJyA9k|fj%2dehTU1&|NwNs?3I0s_?F7Tb W+KCbmhqzI$!J$5%(d2A)*8K 0: @@ -364,13 +364,13 @@ def new_folders(self): self.mainapp.undo_redo_states.reset_redo() #def rename_folder(sel) - def new_file(self, mode, initialvalue=''): - if mode == 'edit': + def new_file(self, mode, initialvalue=""): + if mode == "edit" or mode == "edit folder": self.orig_file_name = initialvalue - elif mode == 'new excel': - initialvalue = '.xlsx' - elif mode == 'new word': - initialvalue = '.docx' + elif mode == "new excel": + initialvalue = ".xlsx" + elif mode == "new word": + initialvalue = ".docx" if mode == "edit": window_mode = "Rename" @@ -388,7 +388,11 @@ def new_file(self, mode, initialvalue=''): #check file does not exist if mode == "new" or mode == "new excel" or mode == "new word": if os.path.isfile(os.path.join(self.explorer.current_directory, new_name)): - msg = 'That File Already Exists!' + msg = "That File Already Exists!" + + if mode == "edit folder": + if os.path.isdir(os.path.join(self.explorer.current_directory, new_name)): + msg = "That Folder Already Exists!" # Check if user input is just a bunch of spaces if new_name.strip() == '': @@ -402,9 +406,9 @@ def new_file(self, mode, initialvalue=''): messagebox.showerror('Error', message=msg) self.new_file(mode, initialvalue=new_name) else: - if mode == 'new': + if mode == "new": with open(os.path.join(self.explorer.current_directory, new_name), 'w') as f: - f.write('') + f.write("") # New Excel File elif mode == 'new excel': @@ -422,7 +426,11 @@ def new_file(self, mode, initialvalue=''): except Exception as e: if "being used by another" in str(e).lower(): msg = "Permission Denied, Ensure Document is not Open in Another Process" - + elif "access is denied" in str(e).lower(): + if mode == "edit folder": + msg = "Access Denied, Ensure No Files are Open in the Folder" + else: + msg = "Access Denied" else: msg = f"The Following Error Occured\n{str(e)}" diff --git a/src/main.py b/src/main.py index 4f6b6df..1ab32e9 100644 --- a/src/main.py +++ b/src/main.py @@ -48,7 +48,7 @@ def __init__(self, parent, *args, **kwargs): self.load_plugins() def setup_variables(self): - self.version = "0.32.11" + self.version = "0.33.0" self.parent.title(f"Tk Path Finder V{self.version}") self.config_data = config_file_manager.load_config_file(self) self.plugin_folder = ".\Plugins"