OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env 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 from __future__ import with_statement |
6 import StringIO | 7 import StringIO |
7 import os | 8 import os |
8 import sys | 9 import sys |
9 | 10 |
10 class GenerateError(Exception): | 11 class GenerateError(Exception): |
11 | 12 |
12 def __init__(self, value): | 13 def __init__(self, value): |
13 self.value = value | 14 self.value = value |
14 | 15 |
15 def __str__(self): | 16 def __str__(self): |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 *rest): | 109 *rest): |
109 if not path: | 110 if not path: |
110 raise GenerateError("usage: %s NAME OUTPUT PATH EXCLUDE_DIR_NAME ..." | 111 raise GenerateError("usage: %s NAME OUTPUT PATH EXCLUDE_DIR_NAME ..." |
111 % script_name) | 112 % script_name) |
112 base_directory = os.path.dirname(output) | 113 base_directory = os.path.dirname(output) |
113 Generator(base_directory, name, output, path, *rest).generate() | 114 Generator(base_directory, name, output, path, *rest).generate() |
114 | 115 |
115 | 116 |
116 if __name__ == '__main__': | 117 if __name__ == '__main__': |
117 sys.exit(Main(*sys.argv)) | 118 sys.exit(Main(*sys.argv)) |
OLD | NEW |