#NEWLINE# def get_binary_path( self , name , search_system_binaries = True ) : #NEWLINE# #INDENT# "\n        Searches the devices ``binary_directory`` for the given binary,\n        if it cant find it there it tries using which to find it.\n\n        :param name: The name of the binary\n        :param search_system_binaries: By default this function will try using\n                                       which to find the binary if it isn't in\n                                       ``binary_directory``. When this is set\n                                       to ``False`` it will not try this.\n\n        :returns: The on-device path to the binary.\n\n        " #NEWLINE# wa_binary = self . path . join ( self . binaries_directory , name ) #NEWLINE# if self . file_exists ( wa_binary ) : #NEWLINE# #INDENT# return self #NEWLINE# #UNINDENT# if search_system_binaries : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return self . execute ( '{} which {}' . format ( self . busybox , name ) ) . strip ( ) #NEWLINE# #UNINDENT# except DeviceError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# return None