45 lines
897 B
Python
45 lines
897 B
Python
|
#!/usr/bin/env python
|
||
|
#
|
||
|
# Copyright 2016 Google Inc.
|
||
|
#
|
||
|
# Use of this source code is governed by a BSD-style license that can be
|
||
|
# found in the LICENSE file.
|
||
|
|
||
|
|
||
|
"""Create the asset."""
|
||
|
|
||
|
|
||
|
import argparse
|
||
|
import common
|
||
|
import subprocess
|
||
|
import os
|
||
|
|
||
|
|
||
|
SVG_TOOLS = os.path.join(common.INFRA_BOTS_DIR, os.pardir, os.pardir, 'tools',
|
||
|
'svg')
|
||
|
|
||
|
|
||
|
def create_asset(target_dir):
|
||
|
"""Create the asset."""
|
||
|
target_dir = os.path.realpath(target_dir)
|
||
|
|
||
|
if not os.path.exists(target_dir):
|
||
|
os.makedirs(target_dir)
|
||
|
|
||
|
download_svgs_cmd = [
|
||
|
'python', os.path.join(SVG_TOOLS, 'svg_downloader.py'),
|
||
|
'--output_dir', target_dir,
|
||
|
]
|
||
|
subprocess.check_call(download_svgs_cmd)
|
||
|
|
||
|
|
||
|
def main():
|
||
|
parser = argparse.ArgumentParser()
|
||
|
parser.add_argument('--target_dir', '-t', required=True)
|
||
|
args = parser.parse_args()
|
||
|
create_asset(args.target_dir)
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
main()
|