tools/perf/cli_tools/tbmv3/trace_downloader.py
def DownloadHtmlTrace(html_url, download_dir=DEFAULT_TRACE_DIR):
  """Downloads html trace given the url. Returns local path.

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

  remote_path = _GetSubpathInBucket(html_url)
  if not cloud_storage.Exists(cloud_storage.TELEMETRY_OUTPUT, remote_path):
    raise cloud_storage.NotFoundError(
        'HTML trace %s not found in cloud storage.' % html_url)

  cloud_storage.Get(cloud_storage.TELEMETRY_OUTPUT, remote_path, local_path)
  return local_path
Downloads html trace given the url. Returns local path.

  Skips downloading if file was already downloaded once.
Downloads html trace given the url. Returns local path.
Skips downloading if file was already downloaded once.
Downloads html trace given the url . Returns local path . Skips downloading if file was already downloaded once .
def DownloadHtmlTrace(html_url, download_dir=DEFAULT_TRACE_DIR):
  local_filename = os.path.join(download_dir, GetLocalTraceFileName(html_url))
  local_path = local_filename + '.html'
  if os.path.exists(local_path):
    logging.info('%s already downloaded. Skipping.' % local_path)
    return local_path
  remote_path = _GetSubpathInBucket(html_url)
  if not cloud_storage.Exists(cloud_storage.TELEMETRY_OUTPUT, remote_path):
    raise cloud_storage.NotFoundError(
        'HTML trace %s not found in cloud storage.' % html_url)
  cloud_storage.Get(cloud_storage.TELEMETRY_OUTPUT, remote_path, local_path)
  return local_path
def DownloadHtmlTrace ( html_url , download_dir = DEFAULT_TRACE_DIR ) : local_filename = os . path . join ( download_dir , GetLocalTraceFileName ( html_url ) ) local_path = local_filename + '.html' if os . path . exists ( local_path ) : logging . info ( '%s already downloaded. Skipping.' % local_path ) return local_path remote_path = _GetSubpathInBucket ( html_url ) if not cloud_storage . Exists ( cloud_storage . TELEMETRY_OUTPUT , remote_path ) : raise cloud_storage . NotFoundError ( 'HTML trace %s not found in cloud storage.' % html_url ) cloud_storage . Get ( cloud_storage . TELEMETRY_OUTPUT , remote_path , local_path ) return local_path
Downloads html trace given the url.
Downloads html trace given the url .
"""Downloads html trace given the url. Returns local path.

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