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

Method move_dir

FTP_controller.py:91–102  ·  view source on GitHub ↗
(self, rename_from, rename_to, status_command, replace_command)

Source from the content-addressed store, hash-verified

89 self.ftp.sendcmd('RNTO '+ rename_to)
90
91 def move_dir(self, rename_from, rename_to, status_command, replace_command):
92 if(self.is_there(rename_to) is True):
93 if(replace_command(rename_from, 'File/Folder exists in destination folder') is True):
94 self.delete_dir(rename_to, status_command)
95 else:
96 return
97 try:
98 self.ftp.sendcmd('RNFR '+ rename_from)
99 self.ftp.sendcmd('RNTO '+ rename_to)
100 status_command(rename_from, 'Moved')
101 except:
102 status_command(rename_from, 'Failed to move')
103
104 def copy_file(self, file_dir, copy_from, file_size, status_command, replace_command):
105 #Change to script's directory

Callers 1

clipboard_pasteMethod · 0.45

Calls 2

is_thereMethod · 0.95
delete_dirMethod · 0.95

Tested by

no test coverage detected