Rename partially downloaded images
This commit is contained in:
parent
612f47d551
commit
b213f4cb18
|
@ -18,10 +18,12 @@ def download(ip, dest):
|
|||
|
||||
for f in files:
|
||||
source_file = '/3dscan/' + f
|
||||
dest_file = dest / f
|
||||
dest_file = dest / (f + '.tmp')
|
||||
print('Grabbing file', source_file)
|
||||
sftp.get(source_file, dest_file)
|
||||
sftp.remove(source_file)
|
||||
done_file = dest / f
|
||||
dest_file.rename(done_file)
|
||||
|
||||
if sftp: sftp.close()
|
||||
if transport: transport.close()
|
||||
|
|
Loading…
Reference in New Issue
Block a user