| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 """This module generates Dart Chrome APIs from the Chrome IDL files.""" | 6 """This module generates Dart Chrome APIs from the Chrome IDL files.""" |
| 7 | 7 |
| 8 import sys | 8 import sys |
| 9 import os | 9 import os |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 # The content to fill OUTPUT_TEMPLATE with. Will be followed by a list of the | 29 # The content to fill OUTPUT_TEMPLATE with. Will be followed by a list of the |
| 30 # names of the generated .dart files. | 30 # names of the generated .dart files. |
| 31 TEMPLATE_CONTENT = """ | 31 TEMPLATE_CONTENT = """ |
| 32 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 32 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 33 // for details. All rights reserved. Use of this source code is governed by a | 33 // for details. All rights reserved. Use of this source code is governed by a |
| 34 // BSD-style license that can be found in the LICENSE file. | 34 // BSD-style license that can be found in the LICENSE file. |
| 35 | 35 |
| 36 // DO NOT EDIT | 36 // DO NOT EDIT |
| 37 // Auto-generated dart:chrome library. | 37 // Auto-generated dart:chrome library. |
| 38 | 38 |
| 39 /// Native wrappers for the Chrome Packaged App APIs. | 39 /// Native wrappers for the Chrome packaged app APIs. |
| 40 /// | 40 /// |
| 41 /// These functions allow direct access to the Packaged App APIs, allowing | 41 /// These functions allow direct access to the chrome.* APIs, allowing |
| 42 /// Chrome Packaged Apps to be written using Dart. | 42 /// Chrome packaged apps to be written using Dart. |
| 43 /// | 43 /// |
| 44 /// For more information on these APIs, see the Chrome.* APIs Documentation: | 44 /// For more information on these APIs, see the |
| 45 /// http://developer.chrome.com/extensions/api_index.html | 45 /// [chrome.* API documentation](http://developer.chrome.com/apps/api_index.html
). |
| 46 library chrome; | 46 library chrome; |
| 47 | 47 |
| 48 import 'dart:_foreign_helper' show JS; | 48 import 'dart:_foreign_helper' show JS; |
| 49 /* TODO(sashab): Add "show convertDartClosureToJS" once 'show' works. */ | 49 /* TODO(sashab): Add "show convertDartClosureToJS" once 'show' works. */ |
| 50 import 'dart:_js_helper'; | 50 import 'dart:_js_helper'; |
| 51 import 'dart:html_common'; | 51 import 'dart:html_common'; |
| 52 import 'dart:html'; | 52 import 'dart:html'; |
| 53 | 53 |
| 54 part "$AUXILIARY_DIR/chrome/utils.dart"; | 54 part "$AUXILIARY_DIR/chrome/utils.dart"; |
| 55 part "$AUXILIARY_DIR/chrome/chrome.dart"; | 55 part "$AUXILIARY_DIR/chrome/chrome.dart"; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 # Generate the template. | 88 # Generate the template. |
| 89 files_to_add = (TEMPLATE_FILE_FORMAT % os.path.splitext(f)[0] | 89 files_to_add = (TEMPLATE_FILE_FORMAT % os.path.splitext(f)[0] |
| 90 for f in API_FILES) | 90 for f in API_FILES) |
| 91 with open(OUTPUT_TEMPLATE, 'w') as template_file: | 91 with open(OUTPUT_TEMPLATE, 'w') as template_file: |
| 92 template_file.write(TEMPLATE_CONTENT) | 92 template_file.write(TEMPLATE_CONTENT) |
| 93 template_file.write('\n'.join(files_to_add)) | 93 template_file.write('\n'.join(files_to_add)) |
| 94 print "Generated template succesfully." | 94 print "Generated template succesfully." |
| 95 | 95 |
| 96 | 96 |
| OLD | NEW |