diff --git a/README.md b/README.md new file mode 100644 index 0000000..503b4a7 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# Tk-Path-Finder (WIP) ![python](https://img.shields.io/badge/python-3.6+-blue) + +## Description +A lightweight file explorer based on tabs within tabs written in python (Tkinter). Written primarily to assist working with text files and MS office files spread across many folders/servers. + +## Features + - Quick Access Sidebar, links can be grouped into individual folders. + - Tabs within tabs layout. + - Search functionality. + - Basic file comparison functionality. + - Rename files. + - Create multiple folders at once (hit cntrl-d in the craete folder window to duplicate line). + - "Open with" functionality. + - Plugin system (very much WIP at this time). + +## Limitations + - Only tested on windows 10. + - No delete functionality. + - Search is very slow on sub-directories with many files. + - Paste cannot be cancelled. + - Does not work with MS teams folders. + +## Preview +![alt text](https://i.imgur.com/HNW0v4o.png) diff --git a/src/__pycache__/paste_windows.cpython-39.pyc b/src/__pycache__/paste_windows.cpython-39.pyc index feba777..f56dad5 100644 Binary files a/src/__pycache__/paste_windows.cpython-39.pyc and b/src/__pycache__/paste_windows.cpython-39.pyc differ diff --git a/src/paste_windows.py b/src/paste_windows.py index 12e8fd5..7c13e1b 100644 --- a/src/paste_windows.py +++ b/src/paste_windows.py @@ -8,10 +8,10 @@ from tkinter import messagebox from tkinter import simpledialog import time +import traceback import autoscrollbar - def paste_folder(mainapp, branch_tab, source, destination): launch_window(mainapp, branch_tab, source, destination) @@ -35,10 +35,10 @@ def __init__(self, mainapp, master, branch_tab, source, destination): self.source = source self.destination = destination - processes = [] - processes.append(Process(target=start_paste_folder, args=[source, destination])) + self.processes = [] + self.processes.append(Process(target=start_paste_folder, args=[source, destination])) - for p in processes: + for p in self.processes: p.start() #for p in processes: @@ -53,6 +53,9 @@ def __init__(self, mainapp, master, branch_tab, source, destination): self.pb1 = Progressbar(self.top, orient=HORIZONTAL, length=100, mode='determinate') self.pb1.grid(row=4, column=0, pady=5, sticky='NSEW') + + self.cancel_btn = ttk.Button(self.top, text="Cancel", style='danger.TButton', command=self.cancel_copy) + self.cancel_btn.grid(row=5, column=0, sticky="NW") #self.check_progress() def get_size(self, folder): @@ -71,18 +74,25 @@ def check_progress(self): while True: attempts += 1 - time.sleep(1) + time.sleep(2) current_size = self.get_size(self.destination) progress = round(current_size/self.total_size, 2) - - # if attempts > 30: - # break if progress == 1.0: break else: - self.l.config(text=f'Progress: {str(int(progress*100))}%') - self.pb1['value'] = progress*100 - self.mainapp.root.update() + try: + self.l.config(text=f'Progress: {str(int(progress*100))}%') + self.pb1['value'] = progress*100 + self.mainapp.root.update() + except: + pass + self.top.destroy() + + def cancel_copy(self): + for p in self.processes: + p.terminate() + p.join() + self.top.destroy() \ No newline at end of file