Add ICU message format support
[chromium-blink-merge.git] / tools / polymer / polymer_grdp_to_txt.py
blob9940faa36de29f706259df846b0e4e70f34174d0
1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 import sys
7 import xml.sax
10 class PathsExtractor(xml.sax.ContentHandler):
12 def __init__(self):
13 self.paths = []
15 def startElement(self, name, attrs):
16 if name != 'structure':
17 return
18 path = attrs['file']
19 if path.startswith('../../../third_party/web-animations-js'):
20 return
21 prefix_1_0 = '../../../third_party/polymer/v1_0/components-chromium/'
22 if path.startswith(prefix_1_0):
23 self.paths.append(path[len(prefix_1_0):])
24 else:
25 raise Exception("Unexpected path %s." % path)
27 def main(argv):
28 xml_handler = PathsExtractor()
29 xml.sax.parse(argv[1], xml_handler)
30 print '\n'.join(sorted(xml_handler.paths))
33 if __name__ == '__main__':
34 sys.exit(main(sys.argv))