Create new set of SVGs
Context is in the below bug
Bug: skia:6918
Change-Id: Ic9048311092bd7e73dd6ee182e79abea79baa07a
Reviewed-on: https://skia-review.googlesource.com/30586
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
diff --git a/tools/svg/svg_downloader.py b/tools/svg/svg_downloader.py
index 94a0b6f..769c8ff 100644
--- a/tools/svg/svg_downloader.py
+++ b/tools/svg/svg_downloader.py
@@ -15,11 +15,11 @@
PARENT_DIR = os.path.dirname(os.path.realpath(__file__))
-def downloadSVGs(svgs_file, output_dir):
+def downloadSVGs(svgs_file, output_dir, prefix):
with open(svgs_file, 'r') as f:
for url in f.xreadlines():
svg_url = url.strip()
- dest_file = os.path.join(output_dir, os.path.basename(svg_url))
+ dest_file = os.path.join(output_dir, prefix + os.path.basename(svg_url))
print 'Downloading %s' % svg_url
urllib.urlretrieve(svg_url, dest_file)
@@ -34,8 +34,12 @@
option_parser.add_option(
'-o', '--output_dir',
help='The output dir where downloaded SVGs will be stored in.')
+ option_parser.add_option(
+ '-p', '--prefix',
+ help='The prefix which downloaded SVG file will begin with.',
+ default='')
options, unused_args = option_parser.parse_args()
if not options.output_dir:
raise Exception('Must specify --output_dir')
- sys.exit(downloadSVGs(options.svgs_file, options.output_dir))
+ sys.exit(downloadSVGs(options.svgs_file, options.output_dir, options.prefix))