| 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 os | 7 import os |
| 8 import string | 8 import string |
| 9 import sys | 9 import sys |
| 10 | 10 |
| 11 | 11 |
| 12 FILE_TEMPLATE = \ | 12 FILE_TEMPLATE = \ |
| 13 """<?xml version="1.0" encoding="utf-8"?> | 13 """<?xml version="1.0" encoding="utf-8"?> |
| 14 <!-- | 14 <!-- |
| 15 This file is generated. | 15 This file is generated. |
| 16 Please use 'src/tools/polymer/polymer_grdp_to_txt.py' and | 16 Please use 'src/tools/polymer/polymer_grdp_to_txt.py' and |
| 17 'src/tools/polymer/txt_to_polymer_grdp.py' to modify it, if possible. | 17 'src/tools/polymer/txt_to_polymer_grdp.py' to modify it, if possible. |
| 18 | 18 |
| 19 'polymer_grdp_to_txt.py' converts 'polymer_resources.grdp' to a plane list of | 19 'polymer_grdp_to_txt.py' converts 'polymer_resources.grdp' to a plain list of |
| 20 used Polymer components: | 20 used Polymer components: |
| 21 ... | 21 ... |
| 22 iron-iron-iconset/iron-iconset-extracted.js | 22 iron-iron-iconset/iron-iconset-extracted.js |
| 23 iron-iron-iconset/iron-iconset.html | 23 iron-iron-iconset/iron-iconset.html |
| 24 ... | 24 ... |
| 25 | 25 |
| 26 'txt_to_polymer_grdp.py' converts list back to GRDP file. | 26 'txt_to_polymer_grdp.py' converts list back to GRDP file. |
| 27 | 27 |
| 28 Usage: | 28 Usage: |
| 29 $ polymer_grdp_to_txt.py polymer_resources.grdp > /tmp/list.txt | 29 $ polymer_grdp_to_txt.py polymer_resources.grdp > /tmp/list.txt |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 if not os.path.exists(full_path): | 77 if not os.path.exists(full_path): |
| 78 raise FileNotFoundException('%s not found' % full_path) | 78 raise FileNotFoundException('%s not found' % full_path) |
| 79 | 79 |
| 80 template = DEFINITION_TEMPLATE_1_0 | 80 template = DEFINITION_TEMPLATE_1_0 |
| 81 lines['v_1_0'].append( | 81 lines['v_1_0'].append( |
| 82 template % (PathToGritId(path), path)) | 82 template % (PathToGritId(path), path)) |
| 83 print FILE_TEMPLATE % { 'v_1_0': '\n'.join(lines['v_1_0']) } | 83 print FILE_TEMPLATE % { 'v_1_0': '\n'.join(lines['v_1_0']) } |
| 84 | 84 |
| 85 if __name__ == '__main__': | 85 if __name__ == '__main__': |
| 86 sys.exit(main(sys.argv)) | 86 sys.exit(main(sys.argv)) |
| OLD | NEW |