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 from __future__ import with_statement |
7 import StringIO | 7 import StringIO |
8 import os | 8 import os |
9 import sys | 9 import sys |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 elif (filename.endswith('.pyc')): | 47 elif (filename.endswith('.pyc')): |
48 pass | 48 pass |
49 else: | 49 else: |
50 self.resources.append(os.path.join(path, filename)) | 50 self.resources.append(os.path.join(path, filename)) |
51 self.sources.sort() | 51 self.sources.sort() |
52 self.resources.sort() | 52 self.resources.sort() |
53 | 53 |
54 def _print_gypi_files(self, out, name, files): | 54 def _print_gypi_files(self, out, name, files): |
55 out.write(" '%s': [\n" % name) | 55 out.write(" '%s': [\n" % name) |
56 for filename in files: | 56 for filename in files: |
57 out.write(" '%s/%s',\n" % (self.path, filename)) | 57 out.write(''' r'%s',%s''' % (os.path.join(self.path, filename),'\n')) |
zundel
2011/10/25 19:26:44
PYTHON STYLE GUIDE VIOLATION ALERT: need space af
| |
58 out.write(" ],\n") | 58 out.write(" ],\n") |
59 | 59 |
60 def _print_ant_files(self, out, name, files): | 60 def _print_ant_files(self, out, name, files): |
61 out.write(" <filelist id='%s' dir='%s'>\n" % (name, self.path)) | 61 out.write(" <filelist id='%s' dir='%s'>\n" % (name, self.path)) |
62 for filename in files: | 62 for filename in files: |
63 out.write(" <file name='%s'/>\n" % filename) | 63 out.write(" <file name='%s'/>\n" % filename) |
64 out.write(" </filelist>\n") | 64 out.write(" </filelist>\n") |
65 out.write(" <pathconvert pathsep=',' property='%s' refid='%s'>\n" | 65 out.write(" <pathconvert pathsep=',' property='%s' refid='%s'>\n" |
66 % (name, name)) | 66 % (name, name)) |
67 out.write(" <map from='${basedir}/%s/' to=''/>\n" % self.path) | 67 out.write(" <map from='${basedir}/%s/' to=''/>\n" % self.path) |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
109 *rest): | 109 *rest): |
110 if not path: | 110 if not path: |
111 raise GenerateError("usage: %s NAME OUTPUT PATH EXCLUDE_DIR_NAME ..." | 111 raise GenerateError("usage: %s NAME OUTPUT PATH EXCLUDE_DIR_NAME ..." |
112 % script_name) | 112 % script_name) |
113 base_directory = os.path.dirname(output) | 113 base_directory = os.path.dirname(output) |
114 Generator(base_directory, name, output, path, *rest).generate() | 114 Generator(base_directory, name, output, path, *rest).generate() |
115 | 115 |
116 | 116 |
117 if __name__ == '__main__': | 117 if __name__ == '__main__': |
118 sys.exit(Main(*sys.argv)) | 118 sys.exit(Main(*sys.argv)) |
OLD | NEW |