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

Side by Side Diff: sky/sdk/lib/download_material_design_icons

Issue 1132063007: Rationalize Dart mojo and sky package structure (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 | « sky/sdk/lib/assets/material-design-icons.sha1 ('k') | sky/sdk/lib/framework/README.md » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2015 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import os 6 import os
7 import subprocess 7 import subprocess
8 import urllib2 8 import urllib2
9 9
10 sky_lib_dir = os.path.dirname(os.path.abspath(__file__)) 10 sky_lib_dir = os.path.dirname(os.path.abspath(__file__))
11 assets_dir = os.path.join(sky_lib_dir, 'assets') 11 assets_dir = os.path.join(sky_lib_dir, 'assets')
12 sha1_path = os.path.join(assets_dir, 'material-design-icons.sha1') 12 sha1_path = os.path.join(assets_dir, 'material-design-icons.sha1')
13 13
14 with open(sha1_path, 'r') as f: 14 with open(sha1_path, 'r') as f:
15 sha1 = f.read() 15 sha1 = f.read()
16 16
17 tgz_path = os.path.join(assets_dir, 'material-design-icons.tgz') 17 tgz_path = os.path.join(assets_dir, 'material-design-icons.tgz')
18 url = 'https://storage.googleapis.com/mojo/material-design-icons/%s' % sha1 18 url = 'https://storage.googleapis.com/mojo/material-design-icons/%s' % sha1
19 response = urllib2.urlopen(url) 19 response = urllib2.urlopen(url)
20 20
21 with open(tgz_path, 'wb') as f: 21 with open(tgz_path, 'wb') as f:
22 f.write(response.read()) 22 f.write(response.read())
23 23
24 output_path = os.path.join(assets_dir, tgz_path) 24 output_path = os.path.join(assets_dir, tgz_path)
25 subprocess.call([ 25 subprocess.call([
26 'tar', '-xzf', output_path, '-C', assets_dir 26 'tar', '-xzf', output_path, '-C', assets_dir
27 ]) 27 ])
28 28
29 os.unlink(tgz_path) 29 os.unlink(tgz_path)
OLDNEW
« no previous file with comments | « sky/sdk/lib/assets/material-design-icons.sha1 ('k') | sky/sdk/lib/framework/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698