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

Method upload_dnd

whipFTP.py:833–855  ·  view source on GitHub ↗
(self, ftpController, dnd_file_list)

Source from the content-addressed store, hash-verified

831 self.process_thread_requests()
832
833 def upload_dnd(self, ftpController, dnd_file_list):
834 #Thread safe progress function
835 def progress(file_name, status):
836 thread_request_queue.put(lambda:self.progress(file_name, status))
837 #Thread safe replace function
838 def replace(file_name, status):
839 thread_request_queue.put(lambda:self.thread_safe_replace(file_name, status))
840 thread_request_queue.join()
841 with self.thread_lock:
842 return self.replace_flag
843 #Loop through selected items and upload them
844 for file in dnd_file_list:
845 os.chdir('/'.join(file.split('/')[:-1]))
846 file = ''.join(file.split('/')[-1:])
847 if(isfile(file)):
848 ftpController.upload_file(file, os.path.getsize(file), progress, replace)
849 else:
850 ftpController.upload_dir(file, progress, replace)
851 #Update file list and redraw icons
852 thread_request_queue.put(lambda:self.update_file_list())
853 thread_request_queue.put(lambda:self.update_status(' '))
854 thread_request_queue.put(lambda:self.progress('You can now close the window', 'Done'))
855 thread_request_queue.put(lambda:self.console_window.enable_close_button())
856
857
858 def download_window(self):

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