#NEWLINE# def get_dir( self , path ) : #NEWLINE# #INDENT# 'Get the directory matching the given path from a connected device.\n        The path must be a directory.\n\n        This only returns information on the single directory ("ls -ldZ"): to\n        get information about all the directory content recursively, use\n        get_files(path).\n\n        Returns a dictionary (filename, File).' #NEWLINE# path = os . path . normpath ( listing ) #NEWLINE# cmd = [ 'ls' , '-ldZ' , ( ( "'" + path ) + "'" ) ] #NEWLINE# listing = subprocess . check_output ( ( self . shell + cmd ) ) . split ( '\n' ) #NEWLINE# line = listing [ 0 ] . strip ( '\r' ) #NEWLINE# try : #NEWLINE# #INDENT# f = File ( line , os . path . dirname ( path ) , self . android_version ) #NEWLINE# #UNINDENT# except ValueError as e : #NEWLINE# #INDENT# self . log . error ( e ) #NEWLINE# return None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# f . absname : f , #NEWLINE# #UNINDENT# }