auto-t: iwd.py: allow renaming in copy_to_storage

By providing a 'name' keyword argument the file copied will be
renamed to that.
This commit is contained in:
James Prestwood 2021-08-13 12:55:06 -07:00 committed by Denis Kenzior
parent 78f5a5dde4
commit 3adb91fc9e
1 changed files with 4 additions and 1 deletions

View File

@ -1152,11 +1152,14 @@ class IWD(AsyncOpAbstract):
fo.close()
@staticmethod
def copy_to_storage(source, storage_dir=IWD_STORAGE_DIR):
def copy_to_storage(source, storage_dir=IWD_STORAGE_DIR, name=None):
import shutil
assert not os.path.isabs(source)
if name:
storage_dir += '/%s' % name
shutil.copy(source, storage_dir)
@staticmethod