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

Side by Side Diff: experimental/PdfViewer/copy_files.py

Issue 23157003: pdfviewer: workaround gyp issue with multiple files, not being translated into an array in linux (w… (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | gyp/pdfviewer.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import os 1 import os
2 import shutil 2 import shutil
3 import sys 3 import sys
4 4
5 def copyfile(src, dst):
6 fsrc = None
7 fdst = None
8 try:
9 fsrc = open(src, 'rb')
10 fdst = open(dst, 'wb')
11 shutil.copyfileobj(fsrc, fdst)
12 finally:
13 if fdst:
14 fdst.close()
15 if fsrc:
16 fsrc.close()
17
5 dstdir = sys.argv[1] 18 dstdir = sys.argv[1]
6 19
20 if not os.path.exists(dstdir):
21 os.makedirs(dstdir)
22
7 for i in range(2, len(sys.argv)): 23 for i in range(2, len(sys.argv)):
8 shutil.copy(sys.argv[i], dstdir) 24 copyfile(sys.argv[i], os.path.join(dstdir, os.path.basename(sys.argv[i])))
9 25
OLDNEW
« no previous file with comments | « no previous file | gyp/pdfviewer.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698