-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmgallery.py
executable file
·94 lines (80 loc) · 1.92 KB
/
mgallery.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env python
import argparse
import logging.config
from mgallery.settings import LOGGING
logging.config.dictConfig(LOGGING)
parser = argparse.ArgumentParser(prog="python mgallery.py", description="Image deduplicate script.", add_help=True)
parser.add_argument(
"-a",
"--autodelete",
action="store_true",
default=False,
help="Auto delete duplicates",
)
parser.add_argument(
"-d",
"--dump",
action="store_true",
default=False,
help="Create db dump",
)
parser.add_argument(
"-s",
"--scan",
action="store_true",
default=False,
help="Scan directory for images",
)
parser.add_argument(
"-c",
"--compare",
action="store_true",
default=False,
help="Compare duplicated images",
)
parser.add_argument(
"-r",
"--rename",
action="store_true",
default=False,
help="Rename images in the current directory",
)
parser.add_argument(
"-o",
"--resort",
action="store_true",
default=False,
help="Resort images in the current directory",
)
parser.add_argument(
"-t",
"--thumbnails",
action="store_true",
default=False,
help="Create thumbnails for duplicated images",
)
if __name__ == "__main__":
args = parser.parse_args()
if args.autodelete:
from mgallery.autodelete import run_autodelete
run_autodelete()
elif args.dump:
from mgallery.dump import run_dump
run_dump()
elif args.scan:
from mgallery.scanner import run_scanner
run_scanner()
elif args.compare:
from mgallery.compare import run_compare
run_compare()
elif args.rename:
from mgallery.rename import run_rename
run_rename()
elif args.resort:
from mgallery.resort import run_resort
run_resort()
elif args.thumbnails:
from mgallery.thumbnails import run_thumbnails
run_thumbnails()
else:
parser.print_help()