tools/perf/cli_tools/tbmv3/trace_downloader.py
def DownloadProtoTrace(html_url, download_dir=DEFAULT_TRACE_DIR):
  """Downloads the associated proto trace for html trace url. Returns path.

  Skips downloading if file was already downloaded once."""
  local_filename = os.path.join(download_dir, GetLocalTraceFileName(html_url))
  for local_path in [local_filename + '.pb', local_filename + '.pb.gz']:
    if os.path.exists(local_path):
      logging.info('%s already downloaded. Skipping.' % local_path)
      return local_path

  remote_path = FindProtoTracePath(html_url)
  extension = GetFileExtension(remote_path)
  local_path = local_filename + extension

  cloud_storage.Get(cloud_storage.TELEMETRY_OUTPUT, remote_path, local_path)
  return local_path
Downloads the associated proto trace for html trace url. Returns path.

  Skips downloading if file was already downloaded once.
Downloads the associated proto trace for html trace url. Returns path.
Skips downloading if file was already downloaded once.
Downloads the associated proto trace for html trace url . Returns path . Skips downloading if file was already downloaded once .
def DownloadProtoTrace(html_url, download_dir=DEFAULT_TRACE_DIR):
  local_filename = os.path.join(download_dir, GetLocalTraceFileName(html_url))
  for local_path in [local_filename + '.pb', local_filename + '.pb.gz']:
    if os.path.exists(local_path):
      logging.info('%s already downloaded. Skipping.' % local_path)
      return local_path
  remote_path = FindProtoTracePath(html_url)
  extension = GetFileExtension(remote_path)
  local_path = local_filename + extension
  cloud_storage.Get(cloud_storage.TELEMETRY_OUTPUT, remote_path, local_path)
  return local_path
def DownloadProtoTrace ( html_url , download_dir = DEFAULT_TRACE_DIR ) : local_filename = os . path . join ( download_dir , GetLocalTraceFileName ( html_url ) ) for local_path in [ local_filename + '.pb' , local_filename + '.pb.gz' ] : if os . path . exists ( local_path ) : logging . info ( '%s already downloaded. Skipping.' % local_path ) return local_path remote_path = FindProtoTracePath ( html_url ) extension = GetFileExtension ( remote_path ) local_path = local_filename + extension cloud_storage . Get ( cloud_storage . TELEMETRY_OUTPUT , remote_path , local_path ) return local_path
Downloads the associated proto trace for html trace url.
Downloads the associated proto trace for html trace url .
"""Downloads the associated proto trace for html trace url. Returns path.

  Skips downloading if file was already downloaded once."""
html_url
download_dir