Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 import os | |
| 6 import json | |
| 7 | |
| 8 COMPONENTS_DIR = 'components-chromium' | |
| 9 COMPONENT_SUMMARY =\ | |
| 10 """Name: %(name)s | |
| 11 Version: %(version)s | |
| 12 Repository: %(repository)s | |
| 13 Tag: %(tag)s | |
| 14 Revision: %(revision)s | |
| 15 Tree link: %(tree)s | |
| 16 """ | |
| 17 | |
| 18 for entry in sorted(os.listdir(COMPONENTS_DIR)): | |
| 19 component_path = os.path.join(COMPONENTS_DIR, entry) | |
| 20 if not os.path.isdir(component_path): | |
| 21 continue | |
| 22 bower_path = os.path.join(component_path, '.bower.json') | |
| 23 if not os.path.isfile(bower_path): | |
| 24 raise Exception('%s is not a file.' % bower_path) | |
| 25 with open(bower_path) as stream: | |
| 26 info = json.load(stream) | |
| 27 repository = info['_source'] | |
| 28 tree = 'https%s/tree/%s' % (repository[3:-4], info['_resolution']['tag']) | |
| 29 print COMPONENT_SUMMARY % { | |
| 30 'name': info['name'], | |
| 31 'version': info['version'], | |
| 32 'repository': repository, | |
| 33 'tag': info['_resolution']['tag'], | |
|
Dan Beam
2016/02/09 02:06:02
probably doesn't matter much, but when trying to t
| |
| 34 'revision': info['_resolution']['commit'], | |
| 35 'tree': tree | |
| 36 } | |
| OLD | NEW |