(self, directory)
return False
Validate as best as possible that the android build matches the device.

    Goes through build files and checks if the board name is mentioned in the
    |self._BOARD_VERIFICATION_FILE| or in the build archive.

    Args:
      directory: directory where build files are located.
Validate as best as possible that the android build matches the device.
Validate as best as possible that the android build matches the device .
def _VerifyBoard(self, directory):
    """Validate as best as possible that the android build matches the device.

    Goes through build files and checks if the board name is mentioned in the
    |self._BOARD_VERIFICATION_FILE| or in the build archive.

    Args:
      directory: directory where build files are located.
    """
    files = os.listdir(directory)
    board_regex = re.compile(r'require board=(\w+)')
    if self._BOARD_VERIFICATION_FILE in files:
      with open(os.path.join(directory, self._BOARD_VERIFICATION_FILE)) as f:
        for line in f:
          m = board_regex.match(line)
          if m:
            board_name = m.group(1)
            if board_name == self._board:
              return True
            elif board_name:
              return False
            else:
              logger.warning('No board type found in %s.',
                             self._BOARD_VERIFICATION_FILE)
    else:
      logger.warning('%s not found. Unable to use it to verify device.',
                     self._BOARD_VERIFICATION_FILE)

    zip_regex = re.compile(r'.*%s.*\.zip' % re.escape(self._board))
    for f in files:
      if zip_regex.match(f):
        return True

    return False
def _VerifyBoard ( self , directory ) : files = os . listdir ( directory ) board_regex = re . compile ( r'require board=(\w+)' ) if self . _BOARD_VERIFICATION_FILE in files : with open ( os . path . join ( directory , self . _BOARD_VERIFICATION_FILE ) ) as f : for line in f : m = board_regex . match ( line ) if m : board_name = m . group ( 1 ) if board_name == self . _board : return True elif board_name : return False else : logger . warning ( 'No board type found in %s.' , self . _BOARD_VERIFICATION_FILE ) else : logger . warning ( '%s not found. Unable to use it to verify device.' , self . _BOARD_VERIFICATION_FILE ) zip_regex = re . compile ( r'.*%s.*\.zip' % re . escape ( self . _board ) ) for f in files : if zip_regex . match ( f ) : return True return False