-
Notifications
You must be signed in to change notification settings - Fork 137
/
zip.py
39 lines (34 loc) · 991 Bytes
/
zip.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
38
39
import argparse
import inspect
from pathlib import Path
from ..upload import zip_images
class Command:
name = "zip"
help = "zip images into sequences"
def add_basic_arguments(self, parser: argparse.ArgumentParser):
parser.add_argument(
"import_path",
help="Path to your images.",
type=Path,
)
parser.add_argument(
"zip_dir",
help="Path to store zipped images.",
type=Path,
)
parser.add_argument(
"--desc_path",
help='Specify the path to read image description. If it is "-", then read from STDIN.',
default=None,
required=False,
)
def run(self, vars_args: dict):
zip_images(
**(
{
k: v
for k, v in vars_args.items()
if k in inspect.getfullargspec(zip_images).args
}
)
)