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

Side by Side Diff: download_appengine_sdk.py

Issue 25857002: Adding apprtc and downloading of google appengine sdk to webrtc.DEPS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/webrtc/webrtc.DEPS/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « DEPS ('k') | google-appengine.zip.sha1 » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:executable
+ *
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 #!/usr/bin/python
2 # Copyright 2013 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 the appengine SDK from WebRTC storage and unpacks it.
7
8 Requires that depot_tools is installed and in the PATH. This script expects
9 to run with Chrome's base dir as the working directory, e.g. where the .gclient
10 file is. This is what should happen if this script is invoked as a hook action.
11 """
12
13 import os
14 import shutil
15 import sys
16 import subprocess
17 import zipfile
18
19
20 def _DownloadAppEngineZipFile(webrtc_deps_path):
21 print 'Downloading files in %s...' % webrtc_deps_path
22
23 extension = 'bat' if 'win32' in sys.platform else 'py'
24 cmd = ['download_from_google_storage.%s' % extension,
25 '--bucket=chromium-webrtc-resources',
26 '--directory', webrtc_deps_path]
27 subprocess.check_call(cmd)
28
29
30 # This is necessary since Windows won't allow us to unzip onto an existing dir.
31 def _DeleteOldAppEngineDir():
32 app_engine_dir = 'google_appengine'
33 print 'Deleting %s in %s...' % (app_engine_dir, os.getcwd())
34 shutil.rmtree(app_engine_dir, ignore_errors=True)
35
36
37 def _Unzip(path):
38 print 'Unzipping %s in %s...' % (path, os.getcwd())
39 zip_file = zipfile.ZipFile(path)
40 try:
41 zip_file.extractall()
42 finally:
43 zip_file.close()
44
45
46 def main(argv):
47 if len(argv) == 1:
48 return 'Usage: %s <path to webrtc.DEPS>' % argv[0]
49
50 webrtc_deps_path = argv[1]
51 _DownloadAppEngineZipFile(webrtc_deps_path)
52 _DeleteOldAppEngineDir()
kjellander_chromium 2013/10/10 09:53:03 I think this will slow us down too much to run for
53 _Unzip(os.path.join(webrtc_deps_path, 'google-appengine.zip'))
54
55
56 if __name__ == '__main__':
57 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « DEPS ('k') | google-appengine.zip.sha1 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698