mirror of
https://github.com/ARM-software/devlib.git
synced 2025-02-07 13:40:48 +00:00
host: Allow pull
method to deal with directories
Check to see if the the source path is a directory before attempting to pull from the host. Use the copy_tree implementation from `distutils` instead of `shutil` to allow copying into an existing directory.
This commit is contained in:
parent
b7a04c9ebc
commit
f2a88fd1dc
@ -18,6 +18,7 @@ import signal
|
|||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
|
from distutils.dir_util import copy_tree
|
||||||
from getpass import getpass
|
from getpass import getpass
|
||||||
|
|
||||||
from devlib.exception import TargetTransientError, TargetStableError
|
from devlib.exception import TargetTransientError, TargetStableError
|
||||||
@ -54,6 +55,10 @@ class LocalConnection(object):
|
|||||||
# Pull all files matching a wildcard expression
|
# Pull all files matching a wildcard expression
|
||||||
for each_source in iglob(source):
|
for each_source in iglob(source):
|
||||||
shutil.copy(each_source, dest)
|
shutil.copy(each_source, dest)
|
||||||
|
else:
|
||||||
|
if os.path.isdir(source):
|
||||||
|
# Use distutils to allow copying into an existing directory structure.
|
||||||
|
copy_tree(source, dest)
|
||||||
else:
|
else:
|
||||||
shutil.copy(source, dest)
|
shutil.copy(source, dest)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user