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

Side by Side Diff: tools/polymer/polymer_grdp_to_txt.py

Issue 1215543002: Remove Polymer 0.5. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit test Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « third_party/polymer/vulcanize_config.json ('k') | tools/polymer/txt_to_polymer_grdp.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 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 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import sys 6 import sys
7 import xml.sax 7 import xml.sax
8 8
9 9
10 class PathsExtractor(xml.sax.ContentHandler): 10 class PathsExtractor(xml.sax.ContentHandler):
11 11
12 def __init__(self): 12 def __init__(self):
13 self.paths = [] 13 self.paths = []
14 14
15 def startElement(self, name, attrs): 15 def startElement(self, name, attrs):
16 if name != 'structure': 16 if name != 'structure':
17 return 17 return
18 path = attrs['file'] 18 path = attrs['file']
19 if path.startswith('../../../third_party/web-animations-js'): 19 if path.startswith('../../../third_party/web-animations-js'):
20 return 20 return
21 prefix_0_5 = '../../../third_party/polymer/components-chromium/'
22 prefix_1_0 = '../../../third_party/polymer/v1_0/components-chromium/' 21 prefix_1_0 = '../../../third_party/polymer/v1_0/components-chromium/'
23 if path.startswith(prefix_0_5): 22 if path.startswith(prefix_1_0):
24 self.paths.append(path[len(prefix_0_5):]) 23 self.paths.append(path[len(prefix_1_0):])
25 elif path.startswith(prefix_1_0):
26 self.paths.append('v1.0 ' + path[len(prefix_1_0):])
27 else: 24 else:
28 raise Exception("Unexpected path %s." % path) 25 raise Exception("Unexpected path %s." % path)
29 26
30 def main(argv): 27 def main(argv):
31 xml_handler = PathsExtractor() 28 xml_handler = PathsExtractor()
32 xml.sax.parse(argv[1], xml_handler) 29 xml.sax.parse(argv[1], xml_handler)
33 print '\n'.join(sorted(xml_handler.paths)) 30 print '\n'.join(sorted(xml_handler.paths))
34 31
35 32
36 if __name__ == '__main__': 33 if __name__ == '__main__':
37 sys.exit(main(sys.argv)) 34 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « third_party/polymer/vulcanize_config.json ('k') | tools/polymer/txt_to_polymer_grdp.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698