mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-04 07:51:21 +00:00 
			
		
		
		
	target: Make Target.push/pull work with pathlib
Convert paths to str() so that passing a pathlib.Path works.
This commit is contained in:
		
				
					committed by
					
						
						Marc Bonnici
					
				
			
			
				
	
			
			
			
						parent
						
							dd7860d477
						
					
				
				
					commit
					9c8624833e
				
			@@ -485,6 +485,9 @@ class Target(object):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @call_conn
 | 
					    @call_conn
 | 
				
			||||||
    def push(self, source, dest, as_root=False, timeout=None, globbing=False):  # pylint: disable=arguments-differ
 | 
					    def push(self, source, dest, as_root=False, timeout=None, globbing=False):  # pylint: disable=arguments-differ
 | 
				
			||||||
 | 
					        source = str(source)
 | 
				
			||||||
 | 
					        dest = str(dest)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        sources = glob.glob(source) if globbing else [source]
 | 
					        sources = glob.glob(source) if globbing else [source]
 | 
				
			||||||
        self._prepare_xfer('push', sources, dest)
 | 
					        self._prepare_xfer('push', sources, dest)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -541,6 +544,9 @@ class Target(object):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @call_conn
 | 
					    @call_conn
 | 
				
			||||||
    def pull(self, source, dest, as_root=False, timeout=None, globbing=False):  # pylint: disable=arguments-differ
 | 
					    def pull(self, source, dest, as_root=False, timeout=None, globbing=False):  # pylint: disable=arguments-differ
 | 
				
			||||||
 | 
					        source = str(source)
 | 
				
			||||||
 | 
					        dest = str(dest)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if globbing:
 | 
					        if globbing:
 | 
				
			||||||
            sources = self._expand_glob(source, as_root=as_root)
 | 
					            sources = self._expand_glob(source, as_root=as_root)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user