(self, ftpController, file_list, selected_file_indices)
| 798 | self.process_thread_requests() |
| 799 | |
| 800 | def upload(self, ftpController, file_list, selected_file_indices): |
| 801 | #Thread safe progress function |
| 802 | def progress(file_name, status): |
| 803 | thread_request_queue.put(lambda:self.progress(file_name, status)) |
| 804 | #Thread safe replace function |
| 805 | def replace(file_name, status): |
| 806 | thread_request_queue.put(lambda:self.thread_safe_replace(file_name, status)) |
| 807 | thread_request_queue.join() |
| 808 | with self.thread_lock: |
| 809 | return self.replace_flag |
| 810 | #Loop through selected items and upload them |
| 811 | for index in selected_file_indices: |
| 812 | if(isfile(file_list[index])): |
| 813 | ftpController.upload_file(file_list[index], os.path.getsize(file_list[index]), progress, replace) |
| 814 | else: |
| 815 | ftpController.upload_dir(file_list[index], progress, replace) |
| 816 | #Update file list and redraw icons |
| 817 | thread_request_queue.put(lambda:self.update_file_list()) |
| 818 | thread_request_queue.put(lambda:self.update_status(' ')) |
| 819 | thread_request_queue.put(lambda:self.progress('You can now close the window', 'Done')) |
| 820 | thread_request_queue.put(lambda:self.console_window.enable_close_button()) |
| 821 | |
| 822 | def upload_thread_dnd(self): |
| 823 | #Create console/terminal window |
nothing calls this directly
no test coverage detected