1
0
mirror of https://github.com/ARM-software/devlib.git synced 2024-10-06 10:50:51 +01:00

Merge pull request #12 from derkling/fix_andoid_dirpull

android: add support to pull multiple files using wildcard expressions
This commit is contained in:
setrofim 2016-01-26 17:36:18 +00:00
commit d4686d08d1

View File

@ -173,6 +173,15 @@ class AdbConnection(object):
def pull(self, source, dest, timeout=None):
if timeout is None:
timeout = self.timeout
# Pull all files matching a wildcard expression
if os.path.isdir(dest) and \
('*' in source or '?' in source):
command = 'shell ls {}'.format(source)
output = adb_command(self.device, command, timeout=timeout)
for line in output.splitlines():
command = 'pull {} {}'.format(line, dest)
adb_command(self.device, command, timeout=timeout)
return
command = 'pull {} {}'.format(source, dest)
return adb_command(self.device, command, timeout=timeout)