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 import re | 10 import re |
10 from collections import deque | 11 from collections import deque |
11 | 12 |
12 class GenerateError(Exception): | 13 class GenerateError(Exception): |
13 | 14 |
14 def __init__(self, value): | 15 def __init__(self, value): |
15 self.value = value | 16 self.value = value |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 *rest): | 113 *rest): |
113 if not path: | 114 if not path: |
114 raise GenerateError("usage: %s NAME OUTPUT PATH EXCLUDE_DIR_NAME ..." | 115 raise GenerateError("usage: %s NAME OUTPUT PATH EXCLUDE_DIR_NAME ..." |
115 % script_name) | 116 % script_name) |
116 base_directory = os.path.dirname(output) | 117 base_directory = os.path.dirname(output) |
117 Generator(base_directory, name, output, path, *rest).generate() | 118 Generator(base_directory, name, output, path, *rest).generate() |
118 | 119 |
119 | 120 |
120 if __name__ == '__main__': | 121 if __name__ == '__main__': |
121 sys.exit(Main(*sys.argv)) | 122 sys.exit(Main(*sys.argv)) |
OLD | NEW |