-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
37 lines (30 loc) · 1.14 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3
from argparse import ArgumentParser
from extractor import Extractor
parser = ArgumentParser()
parser.add_argument("-f", "--file",
required=True,
help="File path")
parser.add_argument("-a", "--artboard-only",
default=False,
action="store_true",
help="Split artboards in Illustrator into separated SVG files")
parser.add_argument("--no-cleanup",
default=False,
action="store_true",
help="Don't cleanup temporary file")
parser.add_argument("-p", "--inkscape-path",
default=None,
help="Inkscape execution file path")
parser.add_argument("-l", "--log",
default=False,
action="store_true",
help="Write log to file")
args = parser.parse_args()
extractor = Extractor(inkscape_path=args.inkscape_path)
extraction_id = extractor.extract(
args.file,
inkscape_log=args.log,
artboard_only=args.artboard_only,
cleanup=not args.no_cleanup)
print(f'extract ID: {extraction_id}')