MCPcopy Create free account
hub / github.com/RainingComputers/whipFTP / delete_item

Method delete_item

whipFTP.py:974–994  ·  view source on GitHub ↗
(self, ftpController, file_list, detailed_file_list, selected_file_indices)

Source from the content-addressed store, hash-verified

972 self.process_thread_requests()
973
974 def delete_item(self, ftpController, file_list, detailed_file_list, selected_file_indices):
975 #Thread safe progress function
976 def progress(file_name, status):
977 thread_request_queue.put(lambda:self.progress(file_name, status))
978 #Loop through all selected files and folders
979 for index in selected_file_indices:
980 file_name = ftpController.cwd_parent(file_list[index])
981 #If directory
982 if(self.ftpController.is_dir(detailed_file_list[index])):
983 ftpController.delete_dir(file_name, progress)
984 #If file
985 else:
986 ftpController.delete_file(file_name, progress)
987 #Deselect everything
988 thread_request_queue.put(lambda:self.deselect_everything)
989 #Update file list and redraw icons
990 thread_request_queue.put(lambda:self.update_file_list())
991 thread_request_queue.put(lambda:self.update_status(' '))
992 thread_request_queue.put(lambda:self.progress('You can now close the window', 'Done'))
993 thread_request_queue.put(lambda:self.console_window.enable_close_button())
994 thread_request_queue.put(lambda:self.deselect_everything())
995
996
997

Callers

nothing calls this directly

Calls 9

update_file_listMethod · 0.95
update_statusMethod · 0.95
progressMethod · 0.95
deselect_everythingMethod · 0.95
enable_close_buttonMethod · 0.80
cwd_parentMethod · 0.45
is_dirMethod · 0.45
delete_dirMethod · 0.45
delete_fileMethod · 0.45

Tested by

no test coverage detected