aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/PdfViewer
diff options
context:
space:
mode:
authorGravatar edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-08-14 22:05:06 +0000
committerGravatar edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-08-14 22:05:06 +0000
commitfb7b1bf5345e8e9570a2b1e472b2fe2d73a1d626 (patch)
treed800b656dfb35d120c67ca8515b38c8f3598aa9a /experimental/PdfViewer
parent5d18cee176b8a8c01138a43fd561881090ebc810 (diff)
pdfviewer: workaround gyp issue with multiple files, not being translated into an array in linux (works in mac, as per spec)
Review URL: https://codereview.chromium.org/23157003 git-svn-id: http://skia.googlecode.com/svn/trunk@10726 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'experimental/PdfViewer')
-rw-r--r--experimental/PdfViewer/copy_files.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/experimental/PdfViewer/copy_files.py b/experimental/PdfViewer/copy_files.py
index ca04a73497..bd41da1e74 100644
--- a/experimental/PdfViewer/copy_files.py
+++ b/experimental/PdfViewer/copy_files.py
@@ -2,8 +2,24 @@ import os
import shutil
import sys
+def copyfile(src, dst):
+ fsrc = None
+ fdst = None
+ try:
+ fsrc = open(src, 'rb')
+ fdst = open(dst, 'wb')
+ shutil.copyfileobj(fsrc, fdst)
+ finally:
+ if fdst:
+ fdst.close()
+ if fsrc:
+ fsrc.close()
+
dstdir = sys.argv[1]
+if not os.path.exists(dstdir):
+ os.makedirs(dstdir)
+
for i in range(2, len(sys.argv)):
- shutil.copy(sys.argv[i], dstdir)
+ copyfile(sys.argv[i], os.path.join(dstdir, os.path.basename(sys.argv[i])))