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

Side by Side 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, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/python/tests/test_core.py ('k') | third_party/cython/cython_compiler.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import argparse
6 import os
7 import shutil
8 import sys
9
10 def touch(fname):
11 if os.path.exists(fname):
12 os.utime(fname, None)
13 else:
14 open(fname, 'a').close()
15
16 def main():
17 """Command line utility to copy python binary modules to the correct package
18 hierarchy.
19 """
20 parser = argparse.ArgumentParser(
21 description='Copy python binary modules to the correct package '
22 'hierarchy.')
23 parser.add_argument('timestamp', help='The timetsamp file.')
24 parser.add_argument('lib_dir', help='The directory containing the modules')
25 parser.add_argument('destination_dir',
26 help='The destination directory of the module')
27 parser.add_argument('mappings', nargs='+',
28 help='The mapping from module to library.')
29 opts = parser.parse_args()
30
31 if not os.path.exists(opts.destination_dir):
32 os.makedirs(opts.destination_dir)
33
34 for mapping in opts.mappings:
35 [module, library] = mapping.split('=')
36 shutil.copy(os.path.join(opts.lib_dir, library),
37 os.path.join(opts.destination_dir, module))
38
39 touch(opts.timestamp)
40
41 if __name__ == '__main__':
42 main()
OLDNEW
« 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