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

Side by Side Diff: third_party/cython/cp_python_binary_modules.py

Issue 578893002: mojo: Fix dependency for building python bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused variable 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
« no previous file with comments | « mojo/mojo.gyp ('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 try:
33 os.makedirs(opts.destination_dir)
34 except:
35 # Ignore errors on directory creation.
36 pass
37
38 for mapping in opts.mappings:
39 [module, library] = mapping.split('=')
40 shutil.copy(os.path.join(opts.lib_dir, library),
41 os.path.join(opts.destination_dir, module))
42
43 touch(opts.timestamp)
44
45 if __name__ == '__main__':
46 main()
OLDNEW
« no previous file with comments | « mojo/mojo.gyp ('k') | third_party/cython/cython_compiler.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698