Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Unified Diff: third_party/cython/cp_python_binary_modules.py

Issue 377293002: Core mojo API for python. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix dependency issue Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/python/tests/test_core.py ('k') | third_party/cython/cython_compiler.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..dd38e647131ebbc25f682d634f19cc6095e23c89
--- /dev/null
+++ b/third_party/cython/cp_python_binary_modules.py
@@ -0,0 +1,42 @@
+# 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.
+
+import argparse
+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():
+ """Command line utility to copy python binary modules to the correct package
+ hierarchy.
+ """
+ parser = argparse.ArgumentParser(
+ description='Copy python binary modules to the correct package '
+ 'hierarchy.')
+ parser.add_argument('timestamp', help='The timetsamp file.')
+ parser.add_argument('lib_dir', help='The directory containing the modules')
+ parser.add_argument('destination_dir',
+ help='The destination directory of the module')
+ parser.add_argument('mappings', nargs='+',
+ help='The mapping from module to library.')
+ opts = parser.parse_args()
+
+ if not os.path.exists(opts.destination_dir):
+ os.makedirs(opts.destination_dir)
+
+ for mapping in opts.mappings:
+ [module, library] = mapping.split('=')
+ shutil.copy(os.path.join(opts.lib_dir, library),
+ os.path.join(opts.destination_dir, module))
+
+ touch(opts.timestamp)
+
+if __name__ == '__main__':
+ main()
« no previous file with comments | « mojo/python/tests/test_core.py ('k') | third_party/cython/cython_compiler.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698