• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python
2#
3# Copyright 2016 Google Inc.
4#
5# Use of this source code is governed by a BSD-style license that can be
6# found in the LICENSE file.
7
8
9"""Create the asset."""
10
11
12import argparse
13import common
14from assets import asset_utils
15
16
17def create_asset(target_dir):
18  """Create the asset."""
19  # The common case is to add one or more images to the existing set. Therefore,
20  # download the previous version first.
21  asset = asset_utils.Asset(common.ASSET_NAME, asset_utils.MultiStore())
22  asset.download_current_version(target_dir)
23
24  # Allow the user to modify the contents of the target dir.
25  raw_input('Previous SKImage contents have been downloaded. Please make '
26            'your desired changes in the following directory and press enter '
27            'to continue:\n%s' % target_dir)
28
29
30def main():
31  parser = argparse.ArgumentParser()
32  parser.add_argument('--target_dir', '-t', required=True)
33  args = parser.parse_args()
34  create_asset(args.target_dir)
35
36
37if __name__ == '__main__':
38  main()
39