OLD | NEW |
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 from __future__ import with_statement | 6 from __future__ import with_statement |
7 import string | 7 import string |
8 import sys | 8 import sys |
9 | 9 |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 'txt_to_polymer_grdp.py' converts list back to GRDP file. | 32 'txt_to_polymer_grdp.py' converts list back to GRDP file. |
33 | 33 |
34 Usage: | 34 Usage: |
35 $ polymer_grdp_to_txt.py polymer_resources.grdp > /tmp/list.txt | 35 $ polymer_grdp_to_txt.py polymer_resources.grdp > /tmp/list.txt |
36 $ vim /tmp/list.txt | 36 $ vim /tmp/list.txt |
37 $ txt_to_polymer_grdp.py /tmp/list.txt > polymer_resources.grdp | 37 $ txt_to_polymer_grdp.py /tmp/list.txt > polymer_resources.grdp |
38 --> | 38 --> |
39 <grit-part> | 39 <grit-part> |
40 <!-- Polymer 0.5 (TODO: Remove by M45 branch point) --> | 40 <!-- Polymer 0.5 (TODO: Remove by M45 branch point) --> |
41 %(v_0_5)s | 41 %(v_0_5)s |
42 <structure name="IDR_POLYMER_WEB_ANIMATIONS_JS_WEB_ANIMATIONS_NEXT_LITE_MIN_JS
" | |
43 file="../../../third_party/web-animations-js/sources/web-animations
-next-lite.min.js" | |
44 type="chrome_html" /> | |
45 <structure name="IDR_POLYMER_WEB_ANIMATIONS_JS_WEB_ANIMATIONS_NEXT_LITE_MIN_JS
_MAP" | |
46 file="../../../third_party/web-animations-js/sources/web-animations
-next-lite.min.js.map" | |
47 type="chrome_html" /> | |
48 | 42 |
49 <!-- Polymer 1.0 --> | 43 <!-- Polymer 1.0 --> |
50 %(v_1_0)s | 44 %(v_1_0)s |
| 45 <structure name="IDR_POLYMER_1_0_WEB_ANIMATIONS_JS_WEB_ANIMATIONS_NEXT_LITE_MI
N_JS" |
| 46 file="../../../third_party/web-animations-js/sources/web-animations
-next-lite.min.js" |
| 47 type="chrome_html" /> |
51 </grit-part> | 48 </grit-part> |
52 """ | 49 """ |
53 | 50 |
54 | 51 |
55 DEFINITION_TEMPLATE_0_5 = \ | 52 DEFINITION_TEMPLATE_0_5 = \ |
56 """ <structure name="%s" | 53 """ <structure name="%s" |
57 file="../../../third_party/polymer/components-chromium/%s" | 54 file="../../../third_party/polymer/components-chromium/%s" |
58 type="chrome_html" />""" | 55 type="chrome_html" />""" |
59 | 56 |
60 DEFINITION_TEMPLATE_1_0 = \ | 57 DEFINITION_TEMPLATE_1_0 = \ |
(...skipping 24 matching lines...) Expand all Loading... |
85 lines = { 'v_0_5': [], 'v_1_0': [] } | 82 lines = { 'v_0_5': [], 'v_1_0': [] } |
86 for (path, is_1_0) in sorted(set(records), key=SortKey): | 83 for (path, is_1_0) in sorted(set(records), key=SortKey): |
87 template = DEFINITION_TEMPLATE_1_0 if is_1_0 else DEFINITION_TEMPLATE_0_5 | 84 template = DEFINITION_TEMPLATE_1_0 if is_1_0 else DEFINITION_TEMPLATE_0_5 |
88 lines['v_1_0' if is_1_0 else 'v_0_5'].append( | 85 lines['v_1_0' if is_1_0 else 'v_0_5'].append( |
89 template % (PathToGritId(path, is_1_0), path)) | 86 template % (PathToGritId(path, is_1_0), path)) |
90 print FILE_TEMPLATE % { 'v_0_5': '\n'.join(lines['v_0_5']), | 87 print FILE_TEMPLATE % { 'v_0_5': '\n'.join(lines['v_0_5']), |
91 'v_1_0': '\n'.join(lines['v_1_0']) } | 88 'v_1_0': '\n'.join(lines['v_1_0']) } |
92 | 89 |
93 if __name__ == '__main__': | 90 if __name__ == '__main__': |
94 sys.exit(main(sys.argv)) | 91 sys.exit(main(sys.argv)) |
OLD | NEW |