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

Side by Side Diff: infra/bots/assets/svg/create.py

Issue 2235763002: Add "svg" asset (Closed) Base URL: https://skia.googlesource.com/skia@svgs
Patch Set: Initial upload Created 4 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
« no previous file with comments | « infra/bots/assets/svg/common.py ('k') | infra/bots/assets/svg/create_and_upload.py » ('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 # 2 #
3 # Copyright 2016 Google Inc. 3 # Copyright 2016 Google Inc.
4 # 4 #
5 # Use of this source code is governed by a BSD-style license that can be 5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file. 6 # found in the LICENSE file.
7 7
8 8
9 """Create the asset.""" 9 """Create the asset."""
10 10
11 11
12 import argparse 12 import argparse
13 import common
14 import subprocess
15 import os
16
17
18 SVG_TOOLS = os.path.join(common.INFRA_BOTS_DIR, os.pardir, os.pardir, 'tools',
19 'svg')
13 20
14 21
15 def create_asset(target_dir): 22 def create_asset(target_dir):
16 """Create the asset.""" 23 """Create the asset."""
17 raise NotImplementedError('Implement me!') 24 target_dir = os.path.realpath(target_dir)
25
26 if not os.path.exists(target_dir):
27 os.makedirs(target_dir)
28
29 download_svgs_cmd = [
30 'python', os.path.join(SVG_TOOLS, 'svg_downloader.py'),
31 '--output_dir', target_dir,
32 ]
33 subprocess.check_call(download_svgs_cmd)
18 34
19 35
20 def main(): 36 def main():
21 parser = argparse.ArgumentParser() 37 parser = argparse.ArgumentParser()
22 parser.add_argument('--target_dir', '-t', required=True) 38 parser.add_argument('--target_dir', '-t', required=True)
23 args = parser.parse_args() 39 args = parser.parse_args()
24 create_asset(args.target_dir) 40 create_asset(args.target_dir)
25 41
26 42
27 if __name__ == '__main__': 43 if __name__ == '__main__':
28 main() 44 main()
OLDNEW
« no previous file with comments | « infra/bots/assets/svg/common.py ('k') | infra/bots/assets/svg/create_and_upload.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698