@@ -0,0 +1,2466 @@
+#!/usr/bin/env python%0A# Copyright (c) 2013 The Chromium Authors. All rights reserved.%0A# Use of this source code is governed by a BSD-style license that can be%0A# found in the LICENSE file.%0A%0A%22%22%22Chrome Version Tool%0A%0AScrapes Chrome channel information and prints out the requested nugget of%0Ainformation.%0A%22%22%22%0A%0Aimport json%0Aimport optparse%0Aimport os%0Aimport string%0Aimport sys%0Aimport urllib%0A%0AURL = 'https://omahaproxy.appspot.com/json'%0A%0A%0Adef main():%0A  try:%0A    data = json.load(urllib.urlopen(URL))%0A  except Exception as e:%0A    print 'Error: could not load %25s%5Cn%5Cn%25s' %25 (URL, str(e))%0A    return 1%0A%0A  # Iterate to find out valid values for OS, channel, and field options.%0A  oses = set()%0A  channels = set()%0A  fields = set()%0A%0A  for os_versions in data:%0A    oses.add(os_versions%5B'os'%5D)%0A%0A    for version in os_versions%5B'versions'%5D:%0A      for field in version:%0A        if field == 'channel':%0A          channels.add(version%5B'channel'%5D)%0A        else:%0A          fields.add(field)%0A%0A  oses = sorted(oses)%0A  channels = sorted(channels)%0A  fields = sorted(fields)%0A%0A  # Command line parsing fun begins!%0A  usage = ('%25prog %5Boptions%5D%5Cn'%0A           'Print out information about a particular Chrome channel.')%0A  parser = optparse.OptionParser(usage=usage)%0A%0A  parser.add_option('-o', '--os',%0A                    choices=oses,%0A                    default='win',%0A                    help='The operating system of interest: %25s '%0A                         '%5Bdefault: %25%25default%5D' %25 ', '.join(oses))%0A  parser.add_option('-c', '--channel',%0A                    choices=channels,%0A                    default='stable',%0A                    help='The channel of interest: %25s '%0A                         '%5Bdefault: %25%25default%5D' %25 ', '.join(channels))%0A  parser.add_option('-f', '--field',%0A                    choices=fields,%0A                    default='version',%0A                    help='The field of interest: %25s '%0A                         '%5Bdefault: %25%25default%5D ' %25 ', '.join(fields))%0A  (opts, args) = parser.parse_args()%0A%0A  # Print out requested data if available.%0A  for os_versions in data:%0A    if os_versions%5B'os'%5D != opts.os:%0A      continue%0A%0A    for version in os_versions%5B'versions'%5D:%0A      if version%5B'channel'%5D != opts.channel:%0A        continue%0A%0A      if opts.field not in version:%0A        continue%0A%0A      print version%5Bopts.field%5D%0A      return 0%0A%0A  print 'Error: unable to find %25s for Chrome %25s %25s.' %25 (%0A      opts.field, opts.os, opts.channel)%0A  return 1%0A%0Aif __name__ == '__main__':%0A  sys.exit(main())%0A

Add omahaproxy.py for accessing Chrome channel information from the command line.