-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathop_dedupe.py
executable file
·54 lines (41 loc) · 1.07 KB
/
op_dedupe.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
#!/usr/bin/env python3
"""1Password Deduplication Manager."""
import argparse
import logging
import sys
try:
import gui_kivy
KIVY_ENABLED = True
except ModuleNotFoundError:
KIVY_ENABLED = False
import gui_tkinter
def init_argparse():
parser = argparse.ArgumentParser(
description="Find and manage duplicate items in 1Password."
)
parser.add_argument("--vault", type=str, help="Act only on this vault.")
parser.add_argument(
"--use_kivy",
action="store_true",
default=True,
help="Use the alpha Kivy GUI library instead of Tkinter",
)
return parser
def main():
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s:%(levelname)s:%(message)s",
stream=sys.stderr,
)
parser = init_argparse()
args = parser.parse_args()
vault = None
if args.vault:
vault = args.vault
if KIVY_ENABLED and args.use_kivy:
tool = gui_kivy.KivyGUI(vault)
else:
tool = gui_tkinter.TkinterGUI(vault)
tool.run()
if __name__ == "__main__":
main()