Chromium Code Reviews| Index: third_party/cython/cp_python_binary_modules.py |
| diff --git a/third_party/cython/cp_python_binary_modules.py b/third_party/cython/cp_python_binary_modules.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0b16ab0a09df41e67976fc354ccca04847042b9d |
| --- /dev/null |
| +++ b/third_party/cython/cp_python_binary_modules.py |
| @@ -0,0 +1,33 @@ |
| +# Copyright 2014 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
|
pkl (ping after 24h if needed)
2014/08/21 09:32:48
Please add docstring. This looks like something th
qsr
2014/08/21 12:10:05
Done.
|
| +import os |
| +import shutil |
| +import sys |
| + |
| +def touch(fname): |
| + if os.path.exists(fname): |
| + os.utime(fname, None) |
| + else: |
| + open(fname, 'a').close() |
| + |
| +def main(): |
| + assert len(sys.argv) >= 4 |
| + timestamp = sys.argv[1] |
| + lib_dir = sys.argv[2] |
| + destination_dir = sys.argv[3] |
| + mappings = sys.argv[4:] |
| + |
| + if not os.path.exists(destination_dir): |
| + os.makedirs(destination_dir) |
| + |
| + for mapping in mappings: |
| + [module, library] = mapping.split('=') |
| + shutil.copy(os.path.join(lib_dir, library), |
| + os.path.join(destination_dir, module)) |
| + |
| + touch(timestamp) |
| + |
| +if __name__ == '__main__': |
| + main() |