mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-04 07:51:21 +00: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:
		@@ -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)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user