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

Side by Side Diff: gyp/copy_file.py

Issue 972743003: Revert of Add SkCodec, including PNG implementation. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | « gyp/common_variables.gypi ('k') | gyp/libpng.gyp » ('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 #!/usr/bin/python
2
3 # Copyright 2015 Google Inc.
4 #
5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file.
7
8 """
9 Copy a file.
10 """
11
12 import argparse
13 import os
14 import shutil
15
16 if __name__ == '__main__':
17 parser = argparse.ArgumentParser()
18 parser.add_argument('src', help='File to copy.')
19 parser.add_argument('dst', help='Location to copy to.')
20 args = parser.parse_args()
21
22 src = os.path.abspath(os.path.join(os.getcwd(), args.src))
23 dst = os.path.abspath(os.path.join(os.getcwd(), args.dst))
24
25 print 'Copying from %s to %s' % (src, dst)
26
27 src_dir = os.path.dirname(src)
28 if not os.path.exists(src_dir):
29 raise AssertionError('src directory %s does not exist!' % src_dir)
30
31 if not os.path.exists(src):
32 raise AssertionError('file to copy %s does not exist' % src)
33
34 dst_dir = os.path.dirname(dst)
35 if not os.path.exists(dst_dir):
36 print 'dst directory %s does not exist! creating it!' % dst_dir
37 os.makedirs(dst_dir)
38
39 shutil.copyfile(src, dst)
OLDNEW
« no previous file with comments | « gyp/common_variables.gypi ('k') | gyp/libpng.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698