def GetUserAgent(get_version=sdk_update_checker.GetVersionObject, get_platform=appengine_rpc.GetPlatformToken, sdk_product=SDK_PRODUCT):
 product_tokens = []
 sdk_name = os.environ.get('APPCFG_SDK_NAME')
 if sdk_name:
  product_tokens.append(sdk_name)
 else:
  version = get_version()
  if (version is None):
   release = 'unknown'
  else:
   release = version['release']
  product_tokens.append(('%s/%s' % (sdk_product, release)))
 product_tokens.append(get_platform())
 python_version = '.'.join((str(i) for i in sys.version_info))
 product_tokens.append(('Python/%s' % python_version))
 return ' '.join(product_tokens)

def GetUserAgent ( get_version = sdk_update_checker . GetVersionObject , get_platform = appengine_rpc . GetPlatformToken , sdk_product = SDK_PRODUCT ) : product_tokens = [ ] sdk_name = os . environ . get ( 'APPCFG_SDK_NAME' ) if sdk_name : product_tokens . append ( sdk_name ) else : version = get_version ( ) if ( version is None ) : release = 'unknown' else : release = version [ 'release' ] product_tokens . append ( ( '%s/%s' % ( sdk_product , release ) ) ) product_tokens . append ( get_platform ( ) ) python_version = '.' . join ( ( str ( i ) for i in sys . version_info ) ) product_tokens . append ( ( 'Python/%s' % python_version ) ) return ' ' . join ( product_tokens )
determines the value of the user-agent header to use for http requests .