OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2011, 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 is the entry point to create Dart APIs from the IDL database.""" | 6 """This is the entry point to create Dart APIs from the IDL database.""" |
7 | 7 |
8 import dartgenerator | 8 import dartgenerator |
9 import database | 9 import database |
10 import logging.config | 10 import logging.config |
(...skipping 13 matching lines...) Expand all Loading... |
24 'BarProp': 'BarInfo', | 24 'BarProp': 'BarInfo', |
25 'DedicatedWorkerGlobalScope': 'DedicatedWorkerContext', | 25 'DedicatedWorkerGlobalScope': 'DedicatedWorkerContext', |
26 'FormData': 'DOMFormData', | 26 'FormData': 'DOMFormData', |
27 'Selection': 'DOMSelection', | 27 'Selection': 'DOMSelection', |
28 'SharedWorkerGlobalScope': 'SharedWorkercontext', | 28 'SharedWorkerGlobalScope': 'SharedWorkercontext', |
29 'Window': 'DOMWindow', | 29 'Window': 'DOMWindow', |
30 'WorkerGlobalScope': 'WorkerContext'} | 30 'WorkerGlobalScope': 'WorkerContext'} |
31 | 31 |
32 _webkit_renames_inverse = dict((v,k) for k, v in _webkit_renames.iteritems()) | 32 _webkit_renames_inverse = dict((v,k) for k, v in _webkit_renames.iteritems()) |
33 | 33 |
34 def main(): | 34 def GenerateDOM(): |
| 35 # TODO(sra): Make this entry point also generate HTML. |
35 current_dir = os.path.dirname(__file__) | 36 current_dir = os.path.dirname(__file__) |
36 logging.config.fileConfig(os.path.join(current_dir, 'logging.conf')) | |
37 | 37 |
38 generator = dartgenerator.DartGenerator( | 38 generator = dartgenerator.DartGenerator( |
39 auxiliary_dir=os.path.join(current_dir, '..', 'src'), | 39 auxiliary_dir=os.path.join(current_dir, '..', 'src'), |
40 base_package='') | 40 base_package='') |
41 generator.LoadAuxiliary() | 41 generator.LoadAuxiliary() |
42 | 42 |
43 common_database = database.Database( | 43 common_database = database.Database( |
44 os.path.join(current_dir, '..', 'database')) | 44 os.path.join(current_dir, '..', 'database')) |
45 common_database.Load() | 45 common_database.Load() |
46 # Remove these types since they are mapped directly to dart. | 46 # Remove these types since they are mapped directly to dart. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 common_prefix = 'common', | 81 common_prefix = 'common', |
82 super_map = _webkit_renames_inverse) | 82 super_map = _webkit_renames_inverse) |
83 | 83 |
84 generator.Flush() | 84 generator.Flush() |
85 | 85 |
86 # Install default DOM library. | 86 # Install default DOM library. |
87 default = os.path.join(lib_dir, DOM_DEFAULT_LIBRARY) | 87 default = os.path.join(lib_dir, DOM_DEFAULT_LIBRARY) |
88 target = os.path.join(lib_dir, DOM_LIBRARY) | 88 target = os.path.join(lib_dir, DOM_LIBRARY) |
89 shutil.copyfile(default, target) | 89 shutil.copyfile(default, target) |
90 | 90 |
| 91 def main(): |
| 92 current_dir = os.path.dirname(__file__) |
| 93 logging.config.fileConfig(os.path.join(current_dir, 'logging.conf')) |
| 94 GenerateDOM() |
| 95 |
91 if __name__ == '__main__': | 96 if __name__ == '__main__': |
92 sys.exit(main()) | 97 sys.exit(main()) |
OLD | NEW |