def CheckForUpdates(self):
    version = self._ParseVersionFile()
    if version is None:
      logging.info('Skipping update check')
      return
    logging.info('Checking for updates to the SDK.')

    responses = {}



    try:
      for runtime in self.runtimes:
        responses[runtime] = yaml.safe_load(self.rpcserver.Send(
            '/api/updatecheck',
            timeout=UPDATE_CHECK_TIMEOUT,
            release=version['release'],
            timestamp=version['timestamp'],
            api_versions=version['api_versions'],
            runtime=runtime))
    except (urllib2.URLError, socket.error, ssl.SSLError), e:
      logging.info('Update check failed: %s', e)
      return



    try:
      latest = sorted(responses.values(), reverse=True,
                      key=lambda release: _VersionList(release['release']))[0]
    except ValueError:
      logging.warn('Could not parse this release version')

    if version['release'] == latest['release']:
      logging.info('The SDK is up to date.')
      return

    try:
      this_release = _VersionList(version['release'])
    except ValueError:
      logging.warn('Could not parse this release version (%r)',
                   version['release'])
    else:
      try:
        advertised_release = _VersionList(latest['release'])
      except ValueError:
        logging.warn('Could not parse advertised release version (%r)',
                     latest['release'])
      else:
        if this_release > advertised_release:
          logging.info('This SDK release is newer than the advertised release.')
          return

    for runtime, response in responses.items():
      api_versions = _GetSupportedApiVersions(response, runtime)
      obsolete_versions = sorted(
          self.runtime_to_api_version[runtime] - set(api_versions))
      if len(obsolete_versions) == 1:
        self._Nag(
            'The api version you are using (%s) is obsolete!  You should\n'
            'upgrade your SDK and test that your code works with the new\n'
            'api version.' % obsolete_versions[0],
            response, version, force=True)
      elif obsolete_versions:
        self._Nag(
            'The api versions you are using (%s) are obsolete!  You should\n'
            'upgrade your SDK and test that your code works with the new\n'
            'api version.' % obsolete_versions,
            response, version, force=True)

      deprecated_versions = sorted(
          self.runtime_to_api_version[runtime].intersection(api_versions[:-1]))
      if len(deprecated_versions) == 1:
        self._Nag(
            'The api version you are using (%s) is deprecated. You should\n'
            'upgrade your SDK to try the new functionality.' %
            deprecated_versions[0], response, version)
      elif deprecated_versions:
        self._Nag(
            'The api versions you are using (%s) are deprecated. You should\n'
            'upgrade your SDK to try the new functionality.' %
            deprecated_versions, response, version)

    self._Nag('There is a new release of the SDK available.',
              latest, version)
Queries the server for updates and nags the user if appropriate.
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/tools/sdk_update_checker.py/SDKUpdateChecker.CheckForUpdates