OLD | NEW |
---|---|
(Empty) | |
1 #!/usr/bin/env python | |
2 # 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.
| |
3 # Use of this source code is governed by a BSD-style license that can be | |
4 # found in the LICENSE file. | |
5 | |
6 import sys | |
7 import xml.sax | |
8 | |
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.
| |
9 class PathsExtractor(xml.sax.ContentHandler): | |
10 def __init__(self): | |
11 self.paths = [] | |
12 | |
13 def startElement(self, name, attrs): | |
14 if name != 'structure': | |
15 return | |
16 path = attrs['file'] | |
17 if path.startswith('../../../third_party/web-animations-js'): | |
18 return | |
19 prefix = '../../../third_party/polymer/components-chromium/' | |
20 if not path.startswith(prefix): | |
21 raise Exception("Unexpected path %s." % path) | |
22 self.paths.append(path[len(prefix):]) | |
23 | |
Dan Beam
2015/03/16 19:28:10
if __name__ == '__main__':
dzhioev (left Google)
2015/03/17 12:43:18
Done.
| |
24 xml_handler = PathsExtractor() | |
25 xml.sax.parse(sys.argv[1], xml_handler) | |
26 print '\n'.join(sorted(xml_handler.paths)) | |
OLD | NEW |