Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: third_party/polymer/v1_0/create_components_summary.py

Issue 1623693002: Tidy up in Polymer directory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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.exists(bower_path):
michaelpg 2016/01/23 04:28:15 isfile
dzhioev (left Google) 2016/01/25 23:31:35 Done.
24 raise Exception('%s doesn\'t exist.' % bower_path)
25 info = json.load(open(bower_path))
michaelpg 2016/01/23 04:28:15 nit: with open(...
dzhioev (left Google) 2016/01/25 23:31:35 Done.
26 repository = info['_source']
27 tree = 'https%s/tree/%s' % (repository[3:][:-4], info['_resolution']['tag'])
michaelpg 2016/01/23 04:28:15 [3:-4]
dzhioev (left Google) 2016/01/25 23:31:35 Done.
28 print COMPONENT_SUMMARY % {
29 'name': info['name'],
30 'version': info['version'],
31 'repository': repository,
32 'tag': info['_resolution']['tag'],
33 'revision': info['_resolution']['commit'],
34 'tree': tree
35 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698