def renameConfirm(self): print(f"The value of entry field 1: {self.entryField1.get()} and entry field 2: {self.entryField2.get()}") try: renamer.fileRename('y', self.get_file_path(), self.entryField1.get(), self.entryField2.get()) print("Changes made.") except: print("Write error.")
def fileOpen(self): file1 = tk.filedialog.askopenfile() try: self.fileDirectoryPath = os.path.dirname(os.path.realpath(file1.name)) self.entryField1.config(state="normal") self.entryField2.config(state="normal") print(self.fileDirectoryPath) self.updateList(renamer.fileRename('print', self.fileDirectoryPath, self.entryField1.get(), self.entryField2.get())) self.rename_func() except AttributeError: print("No file path selected...")
def rename_func(self): fileDirectory = main_app.get_file_path() print(fileDirectory) removeLetter, replaceWith = main_app.get_entry_fields_tuple() renamer.fileRename('print', fileDirectory, removeLetter, replaceWith)
def keyPress2(self, event): print(f"Entry field 2 updated to {self.entryField2.get()}") self.updateList(renamer.fileRename('print', self.get_file_path(), self.entryField1.get(), self.entryField2.get()))
def keyPress(self, event): print(f"Entry field 1 updated to {self.entryField1.get()}") self.updateList(renamer.fileRename('print', self.fileDirectoryPath, self.entryField1.get(), self.entryField2.get()))