(self, ftpController, clipboard_path_list, clipboard_file_list, detailed_clipboard_file_list, cut, copy)
| 1041 | self.process_thread_requests() |
| 1042 | |
| 1043 | def clipboard_paste(self, ftpController, clipboard_path_list, clipboard_file_list, detailed_clipboard_file_list, cut, copy): |
| 1044 | #Set current status |
| 1045 | thread_request_queue.put(lambda:self.update_status('Moving file(s)...')) |
| 1046 | if(cut is True): |
| 1047 | #Loop through all selected files and folders |
| 1048 | for clipboard_path, file_name in zip(clipboard_path_list, clipboard_file_list): |
| 1049 | ftpController.move_dir(clipboard_path +'/'+file_name, ftpController.pwd()+'/'+file_name, self.progress, self.ask_replace) |
| 1050 | thread_request_queue.put(lambda:self.clear_clipboard()) |
| 1051 | thread_request_queue.put(lambda:self.progress('You can now close the window', 'Done')) |
| 1052 | elif (copy is True): |
| 1053 | #Set current status |
| 1054 | thread_request_queue.put(lambda:self.update_status('Copying file(s)...')) |
| 1055 | #Loop through all selected files and folders |
| 1056 | for clipboard_path, file_name, file_details in zip(clipboard_path_list, clipboard_file_list, detailed_clipboard_file_list): |
| 1057 | #Check for file or directory, use appropriate function |
| 1058 | try: |
| 1059 | if(self.ftpController.is_dir(file_details)): |
| 1060 | ftpController.copy_dir(clipboard_path, file_name, self.progress, self.ask_replace) |
| 1061 | else: |
| 1062 | ftpController.copy_file(clipboard_path, file_name, int(self.ftpController.get_properties(file_details)[3]), self.progress, self.ask_replace) |
| 1063 | except: |
| 1064 | thread_request_queue.put(lambda:self.progress('Failed to copy file/folder', file_name)) |
| 1065 | thread_request_queue.put(lambda:self.clear_clipboard()) |
| 1066 | thread_request_queue.put(lambda:self.progress('You can now close the window', 'Done')) |
| 1067 | #update file list and redraw icons |
| 1068 | thread_request_queue.put(lambda:self.update_file_list()) |
| 1069 | thread_request_queue.put(lambda:self.update_status(' ')) |
| 1070 | thread_request_queue.put(lambda:self.console_window.enable_close_button()) |
| 1071 | |
| 1072 | def clear_clipboard(self): |
| 1073 | del self.clipboard_file_list[:] |
nothing calls this directly
no test coverage detected