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

Method upload

whipFTP.py:800–820  ·  view source on GitHub ↗
(self, ftpController, file_list, selected_file_indices)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

update_file_listMethod · 0.95
update_statusMethod · 0.95
progressMethod · 0.95
enable_close_buttonMethod · 0.80
upload_fileMethod · 0.45
upload_dirMethod · 0.45

Tested by

no test coverage detected