tools/bisect-builds.py
def FetchRevision(context, rev, filename, quit_event=None, progress_event=None):
  """Downloads and unzips revision |rev|.
  @param context A PathContext instance.
  @param rev The Chromium revision number/tag to download.
  @param filename The destination for the downloaded file.
  @param quit_event A threading.Event which will be set by the master thread to
                    indicate that the download should be aborted.
  @param progress_event A threading.Event which will be set by the master thread
                    to indicate that the progress of the download should be
                    displayed.
  """
  def ReportHook(blocknum, blocksize, totalsize):
    if quit_event and quit_event.isSet():
      raise RuntimeError('Aborting download of revision %s' % str(rev))
    if progress_event and progress_event.isSet():
      size = blocknum * blocksize
      if totalsize == -1:  # Total size not known.
        progress = 'Received %d bytes' % size
      else:
        size = min(totalsize, size)
        progress = 'Received %d of %d bytes, %.2f%%' % (
            size, totalsize, 100.0 * size / totalsize)
      # Send a \r to let all progress messages use just one line of output.
      sys.stdout.write('\r' + progress)
      sys.stdout.flush()
  download_url = context.GetDownloadURL(rev)
  try:
    urllib.urlretrieve(download_url, filename, ReportHook)
    if progress_event and progress_event.isSet():
      print()

  except RuntimeError:
    pass
Downloads and unzips revision |rev|.
  @param context A PathContext instance.
  @param rev The Chromium revision number/tag to download.
  @param filename The destination for the downloaded file.
  @param quit_event A threading.Event which will be set by the master thread to
                    indicate that the download should be aborted.
  @param progress_event A threading.Event which will be set by the master thread
                    to indicate that the progress of the download should be
                    displayed.
  
Downloads and unzips revision |rev|.
@param context A PathContext instance.
@param rev The Chromium revision number/tag to download.
@param filename The destination for the downloaded file.
@param quit_event A threading.Event which will be set by the master thread to
indicate that the download should be aborted.
@param progress_event A threading.Event which will be set by the master thread
to indicate that the progress of the download should be
displayed.
Downloads and unzips revision |rev| . @param context A PathContext instance . @param rev The Chromium revision number / tag to download . @param filename The destination for the downloaded file . @param quit_event A threading . Event which will be set by the master thread to indicate that the download should be aborted . @param progress_event A threading . Event which will be set by the master thread to indicate that the progress of the download should be displayed .
def FetchRevision(context, rev, filename, quit_event=None, progress_event=None):
  def ReportHook(blocknum, blocksize, totalsize):
    if quit_event and quit_event.isSet():
      raise RuntimeError('Aborting download of revision %s' % str(rev))
    if progress_event and progress_event.isSet():
      size = blocknum * blocksize
      if totalsize == -1:  
        progress = 'Received %d bytes' % size
      else:
        size = min(totalsize, size)
        progress = 'Received %d of %d bytes, %.2f%%' % (
            size, totalsize, 100.0 * size / totalsize)
      sys.stdout.write('\r' + progress)
      sys.stdout.flush()
  download_url = context.GetDownloadURL(rev)
  try:
    urllib.urlretrieve(download_url, filename, ReportHook)
    if progress_event and progress_event.isSet():
      print()
  except RuntimeError:
    pass
def FetchRevision ( context , rev , filename , quit_event = None , progress_event = None ) : def ReportHook ( blocknum , blocksize , totalsize ) : if quit_event and quit_event . isSet ( ) : raise RuntimeError ( 'Aborting download of revision %s' % str ( rev ) ) if progress_event and progress_event . isSet ( ) : size = blocknum * blocksize if totalsize == - 1 : progress = 'Received %d bytes' % size else : size = min ( totalsize , size ) progress = 'Received %d of %d bytes, %.2f%%' % ( size , totalsize , 100.0 * size / totalsize ) sys . stdout . write ( '\r' + progress ) sys . stdout . flush ( ) download_url = context . GetDownloadURL ( rev ) try : urllib . urlretrieve ( download_url , filename , ReportHook ) if progress_event and progress_event . isSet ( ) : print ( ) except RuntimeError : pass
Downloads and unzips revision |rev|.
Downloads and unzips revision |rev| .
"""Downloads and unzips revision |rev|.
  @param context A PathContext instance.
  @param rev The Chromium revision number/tag to download.
  @param filename The destination for the downloaded file.
  @param quit_event A threading.Event which will be set by the master thread to
                    indicate that the download should be aborted.
  @param progress_event A threading.Event which will be set by the master thread
                    to indicate that the progress of the download should be
                    displayed.
  """ # Total size not known. # Send a \r to let all progress messages use just one line of output.
context
rev
filename
quit_event
progress_event