third_party/webxr_test_pages/update_bucket.py
def write_latest():
  """Updates Cloud Storage latest.html based on available test copies, pointing
  to the latest copy."""
  cr_positions = get_bucket_copies()
  cr_positions.sort(key=int, reverse=True)
  logging.debug('Index: %s', cr_positions)

  if not cr_positions:
    logging.debug('No cr_positions found, skipping generation of latest.html')
    return

  logging.debug('Latest cr position: %s', cr_positions[0])

  template = jinja2.Template(open(LATEST_TEMPLATE).read())
  content = template.render({'revisionString' : cr_positions[0]})
  logging.debug('latest.html content:\n%s', content)

  with tempfile.NamedTemporaryFile(suffix='.html', delete=False) as temp:
    try:
      temp.write(content)
      temp.seek(0)
      temp.close()
      run_modify('gsutil.py', 'cp', temp.name, BUCKET + '/latest.html')
    finally:
      os.unlink(temp.name)
Updates Cloud Storage latest.html based on available test copies, pointing
  to the latest copy.
Updates Cloud Storage latest.html based on available test copies, pointing
to the latest copy.
Updates Cloud Storage latest . html based on available test copies pointing to the latest copy .
def write_latest():
  cr_positions = get_bucket_copies()
  cr_positions.sort(key=int, reverse=True)
  logging.debug('Index: %s', cr_positions)
  if not cr_positions:
    logging.debug('No cr_positions found, skipping generation of latest.html')
    return
  logging.debug('Latest cr position: %s', cr_positions[0])
  template = jinja2.Template(open(LATEST_TEMPLATE).read())
  content = template.render({'revisionString' : cr_positions[0]})
  logging.debug('latest.html content:\n%s', content)
  with tempfile.NamedTemporaryFile(suffix='.html', delete=False) as temp:
    try:
      temp.write(content)
      temp.seek(0)
      temp.close()
      run_modify('gsutil.py', 'cp', temp.name, BUCKET + '/latest.html')
    finally:
      os.unlink(temp.name)
def write_latest ( ) : cr_positions = get_bucket_copies ( ) cr_positions . sort ( key = int , reverse = True ) logging . debug ( 'Index: %s' , cr_positions ) if not cr_positions : logging . debug ( 'No cr_positions found, skipping generation of latest.html' ) return logging . debug ( 'Latest cr position: %s' , cr_positions [ 0 ] ) template = jinja2 . Template ( open ( LATEST_TEMPLATE ) . read ( ) ) content = template . render ( { 'revisionString' : cr_positions [ 0 ] } ) logging . debug ( 'latest.html content:\n%s' , content ) with tempfile . NamedTemporaryFile ( suffix = '.html' , delete = False ) as temp : try : temp . write ( content ) temp . seek ( 0 ) temp . close ( ) run_modify ( 'gsutil.py' , 'cp' , temp . name , BUCKET + '/latest.html' ) finally : os . unlink ( temp . name )
Updates Cloud Storage latest.html based on available test copies, pointing
to the latest copy.
Updates Cloud Storage latest . html based on available test copies pointing to the latest copy .
"""Updates Cloud Storage latest.html based on available test copies, pointing
  to the latest copy."""