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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/polymer/v1_0/components_summary.txt ('k') | third_party/polymer/v1_0/reproduce.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/polymer/v1_0/create_components_summary.py
diff --git a/third_party/polymer/v1_0/create_components_summary.py b/third_party/polymer/v1_0/create_components_summary.py
new file mode 100644
index 0000000000000000000000000000000000000000..a5df89c052aec9276454183c54803e1ee0e13193
--- /dev/null
+++ b/third_party/polymer/v1_0/create_components_summary.py
@@ -0,0 +1,36 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+import json
+
+COMPONENTS_DIR = 'components-chromium'
+COMPONENT_SUMMARY =\
+"""Name: %(name)s
+Version: %(version)s
+Repository: %(repository)s
+Tag: %(tag)s
+Revision: %(revision)s
+Tree link: %(tree)s
+"""
+
+for entry in sorted(os.listdir(COMPONENTS_DIR)):
+ component_path = os.path.join(COMPONENTS_DIR, entry)
+ if not os.path.isdir(component_path):
+ continue
+ bower_path = os.path.join(component_path, '.bower.json')
+ if not os.path.isfile(bower_path):
+ raise Exception('%s is not a file.' % bower_path)
+ with open(bower_path) as stream:
+ info = json.load(stream)
+ repository = info['_source']
+ tree = 'https%s/tree/%s' % (repository[3:-4], info['_resolution']['tag'])
+ print COMPONENT_SUMMARY % {
+ 'name': info['name'],
+ 'version': info['version'],
+ 'repository': repository,
+ 'tag': info['_resolution']['tag'],
Dan Beam 2016/02/09 02:06:02 probably doesn't matter much, but when trying to t
+ 'revision': info['_resolution']['commit'],
+ 'tree': tree
+ }
« no previous file with comments | « third_party/polymer/v1_0/components_summary.txt ('k') | third_party/polymer/v1_0/reproduce.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698