-
Notifications
You must be signed in to change notification settings - Fork 0
/
manager.py
executable file
·48 lines (40 loc) · 1.37 KB
/
manager.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
#!/usr/bin/env python3
"""
Responsible to
"""
__author__ = "Gustavo Luvizotto Cesar"
__email__ = "[email protected]"
import argparse
from retrieve_allowlist import retrieve_allowlist
from transfer_to_objstore import transfer_to_objstore
def main(args):
if args.upload:
transfer_to_objstore(args.output_scan_dir, args.port)
elif args.download:
retrieve_allowlist(args.timestamp, args.port)
if __name__ == "__main__":
main_parser = argparse.ArgumentParser(add_help=False)
main_parser.add_argument("--upload", action="store_true")
main_parser.add_argument("--download", action="store_true")
main_parser.add_argument("--port", required=True, type=int, help="Port number")
main_args, _ = main_parser.parse_known_args()
parser = argparse.ArgumentParser(parents=[main_parser])
if main_args.upload:
parser.add_argument(
"--output-scan-dir",
type=str,
required=main_args.upload,
help="Directory where all results are.",
)
elif main_args.download:
parser.add_argument(
"--timestamp",
type=str,
required=main_args.download,
help="Timestamp in the format YYYYMMDD",
)
args, _ = parser.parse_known_args()
if main_args.download or main_args.upload:
main(args)
else:
parser.print_help()