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

Unified Diff: tools/polymer/polymer_grdp_to_txt.py

Issue 984553002: Added helper scripts for modifying polymer_resources.grdp. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More changes. Created 5 years, 9 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 | « tools/polymer/OWNERS ('k') | tools/polymer/txt_to_polymer_grdp.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/polymer/polymer_grdp_to_txt.py
diff --git a/tools/polymer/polymer_grdp_to_txt.py b/tools/polymer/polymer_grdp_to_txt.py
new file mode 100755
index 0000000000000000000000000000000000000000..45215bccc5ccda37fc15783cb2f009ffb130604a
--- /dev/null
+++ b/tools/polymer/polymer_grdp_to_txt.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+# Copyright 2015 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 sys
+import xml.sax
+
+
+class PathsExtractor(xml.sax.ContentHandler):
+
Dan Beam 2015/03/17 18:37:54 nit: not sure if it's typical to put a \n here
dzhioev (left Google) 2015/03/18 16:38:06 "One blank line between method definitions and bet
+ def __init__(self):
+ self.paths = []
+
+ def startElement(self, name, attrs):
+ if name != 'structure':
+ return
+ path = attrs['file']
+ if path.startswith('../../../third_party/web-animations-js'):
+ return
+ prefix = '../../../third_party/polymer/components-chromium/'
+ if not path.startswith(prefix):
+ raise Exception("Unexpected path %s." % path)
+ self.paths.append(path[len(prefix):])
+
+
+def main(argv):
+ xml_handler = PathsExtractor()
+ xml.sax.parse(argv[1], xml_handler)
+ print '\n'.join(sorted(xml_handler.paths))
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
« no previous file with comments | « tools/polymer/OWNERS ('k') | tools/polymer/txt_to_polymer_grdp.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698