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.
10 class PathsExtractor(xml
.sax
.ContentHandler
):
15 def startElement(self
, name
, attrs
):
16 if name
!= 'structure':
19 if path
.startswith('../../../third_party/web-animations-js'):
21 prefix_0_5
= '../../../third_party/polymer/components-chromium/'
22 prefix_1_0
= '../../../third_party/polymer/v1_0/components-chromium/'
23 if path
.startswith(prefix_0_5
):
24 self
.paths
.append(path
[len(prefix_0_5
):])
25 elif path
.startswith(prefix_1_0
):
26 self
.paths
.append('v1.0 ' + path
[len(prefix_1_0
):])
28 raise Exception("Unexpected path %s." % path
)
31 xml_handler
= PathsExtractor()
32 xml
.sax
.parse(argv
[1], xml_handler
)
33 print '\n'.join(sorted(xml_handler
.paths
))
36 if __name__
== '__main__':
37 sys
.exit(main(sys
.argv
))