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

Side by Side Diff: slave/skia_slave_scripts/utils/download_from_bucket.py

Issue 648353002: Remove Skia's forked buildbot code (Closed) Base URL: https://skia.googlesource.com/buildbot.git@master
Patch Set: Address comment Created 6 years, 2 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
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """Downloads a single file from a Google Storage Bucket.
7
8 To test:
9 cd .../buildbot/slave/skia_slave_scripts/utils
10 CR_BUILDBOT_PATH=../../../third_party/chromium_buildbot
11 PYTHONPATH=$CR_BUILDBOT_PATH/scripts:$CR_BUILDBOT_PATH/site_config \
12 python download_from_bucket.py \
13 --source_gsurl=gs://chromium-skia-gm/DEPS --dest=~/DEPS
14 """
15
16 import optparse
17 import sys
18
19 from slave import slave_utils
20
21
22 def DownloadFromBucket(source_gsurl, dest):
23 status = slave_utils.GSUtilDownloadFile(source_gsurl, dest)
24 if status != 0:
25 raise Exception('ERROR: GSUtilDownloadFile error %d. "%s" -> "%s"' % (
26 status, source_gsurl, dest))
27 return 0
28
29
30 def main(argv):
31 option_parser = optparse.OptionParser()
32 option_parser.add_option(
33 '', '--source_gsurl',
34 help='gs://url of the file to download')
35 option_parser.add_option(
36 '', '--dest',
37 help='Destination file/directory where the file will be downloaded.')
38 (options, _args) = option_parser.parse_args()
39 return DownloadFromBucket(source_gsurl=options.source_gsurl,
40 dest=options.dest)
41
42
43 if '__main__' == __name__:
44 sys.exit(main(None))
OLDNEW
« no previous file with comments | « slave/skia_slave_scripts/utils/__init__.py ('k') | slave/skia_slave_scripts/utils/file_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698