OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # This script is used to copy all dependencies into the local directory. | 6 # This script is used to copy all dependencies into the local directory. |
7 # The package of files can then be uploaded to App Engine. | 7 # The package of files can then be uploaded to App Engine. |
8 import os | 8 import os |
9 import shutil | 9 import shutil |
10 import stat | 10 import stat |
11 import sys | 11 import sys |
12 | 12 |
13 SRC_DIR = os.path.join(sys.path[0], os.pardir, os.pardir, os.pardir, os.pardir, | 13 SRC_DIR = os.path.join(sys.path[0], os.pardir, os.pardir, os.pardir, os.pardir, |
14 os.pardir) | 14 os.pardir) |
15 THIRD_PARTY_DIR = os.path.join(SRC_DIR, 'third_party') | 15 THIRD_PARTY_DIR = os.path.join(SRC_DIR, 'third_party') |
16 LOCAL_THIRD_PARTY_DIR = os.path.join(sys.path[0], 'third_party') | 16 LOCAL_THIRD_PARTY_DIR = os.path.join(sys.path[0], 'third_party') |
17 TOOLS_DIR = os.path.join(SRC_DIR, 'tools') | 17 TOOLS_DIR = os.path.join(SRC_DIR, 'tools') |
18 SCHEMA_COMPILER_FILES = ['model.py', | 18 SCHEMA_COMPILER_FILES = ['memoize.py', |
| 19 'model.py', |
19 'idl_schema.py', | 20 'idl_schema.py', |
20 'schema_util.py', | 21 'schema_util.py', |
21 'json_parse.py'] | 22 'json_parse.py'] |
22 | 23 |
23 def MakeInit(path): | 24 def MakeInit(path): |
24 path = os.path.join(path, '__init__.py') | 25 path = os.path.join(path, '__init__.py') |
25 with open(os.path.join(path), 'w') as f: | 26 with open(os.path.join(path), 'w') as f: |
26 os.utime(os.path.join(path), None) | 27 os.utime(os.path.join(path), None) |
27 | 28 |
28 def OnError(function, path, excinfo): | 29 def OnError(function, path, excinfo): |
(...skipping 28 matching lines...) Expand all Loading... |
57 | 58 |
58 | 59 |
59 CopyThirdParty(os.path.join(THIRD_PARTY_DIR, 'handlebar'), 'handlebar') | 60 CopyThirdParty(os.path.join(THIRD_PARTY_DIR, 'handlebar'), 'handlebar') |
60 CopyThirdParty(os.path.join(SRC_DIR, 'ppapi', 'generators'), | 61 CopyThirdParty(os.path.join(SRC_DIR, 'ppapi', 'generators'), |
61 'json_schema_compiler') | 62 'json_schema_compiler') |
62 CopyThirdParty(os.path.join(THIRD_PARTY_DIR, 'ply'), | 63 CopyThirdParty(os.path.join(THIRD_PARTY_DIR, 'ply'), |
63 os.path.join('json_schema_compiler', 'ply')) | 64 os.path.join('json_schema_compiler', 'ply')) |
64 CopyThirdParty(os.path.join(TOOLS_DIR, 'json_schema_compiler'), | 65 CopyThirdParty(os.path.join(TOOLS_DIR, 'json_schema_compiler'), |
65 'json_schema_compiler', | 66 'json_schema_compiler', |
66 SCHEMA_COMPILER_FILES) | 67 SCHEMA_COMPILER_FILES) |
67 CopyThirdParty(TOOLS_DIR, 'json_schema_compiler', ['json_comment_eater.py']) | 68 CopyThirdParty(os.path.join(TOOLS_DIR, 'json_comment_eater'), |
| 69 'json_schema_compiler', |
| 70 ['json_comment_eater.py']) |
68 CopyThirdParty(os.path.join(THIRD_PARTY_DIR, 'simplejson'), | 71 CopyThirdParty(os.path.join(THIRD_PARTY_DIR, 'simplejson'), |
69 os.path.join('json_schema_compiler', 'simplejson'), | 72 os.path.join('json_schema_compiler', 'simplejson'), |
70 make_init=False) | 73 make_init=False) |
71 MakeInit(LOCAL_THIRD_PARTY_DIR) | 74 MakeInit(LOCAL_THIRD_PARTY_DIR) |
72 | 75 |
73 # To be able to use the Handlebar class we need this import in __init__.py. | 76 # To be able to use the Handlebar class we need this import in __init__.py. |
74 with open(os.path.join(LOCAL_THIRD_PARTY_DIR, | 77 with open(os.path.join(LOCAL_THIRD_PARTY_DIR, |
75 'handlebar', | 78 'handlebar', |
76 '__init__.py'), 'a') as f: | 79 '__init__.py'), 'a') as f: |
77 f.write('from handlebar import Handlebar\n') | 80 f.write('from handlebar import Handlebar\n') |
78 | 81 |
79 if __name__ == '__main__': | 82 if __name__ == '__main__': |
80 main() | 83 main() |
OLD | NEW |