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..a0a7c7b250c5420bb591cfcf858ee6e7501ec213 |
--- /dev/null |
+++ b/tools/polymer/polymer_grdp_to_txt.py |
@@ -0,0 +1,26 @@ |
+#!/usr/bin/env python |
+# Copyright (c) 2015 The Chromium Authors. All rights reserved. |
Dan Beam
2015/03/16 19:28:09
remove "(c) "
dzhioev (left Google)
2015/03/17 12:43:18
Done.
|
+# 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 |
+ |
Dan Beam
2015/03/16 19:28:09
\n\n between file-level globals: https://google-st
dzhioev (left Google)
2015/03/17 12:43:18
Done.
|
+class PathsExtractor(xml.sax.ContentHandler): |
+ 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):]) |
+ |
Dan Beam
2015/03/16 19:28:10
if __name__ == '__main__':
dzhioev (left Google)
2015/03/17 12:43:18
Done.
|
+xml_handler = PathsExtractor() |
+xml.sax.parse(sys.argv[1], xml_handler) |
+print '\n'.join(sorted(xml_handler.paths)) |