-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathupdate_applet.py
49 lines (44 loc) · 1.26 KB
/
update_applet.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
""" This examples updates an existing project dashboard
"""
import argparse
import tator
def main() -> None:
""" Main routine of this script
"""
# Set the arguments and grab them
parser = argparse.ArgumentParser(description="Registers a applet to a Tator project")
parser.add_argument("--host", type=str, required=True)
parser.add_argument("--token", type=str, required=True)
parser.add_argument(
'--applet-id',
help='Unique applet ID',
required=True,
type=int)
parser.add_argument(
'--html-file',
help='Path to the applet html file',
type=str)
parser.add_argument(
'--name',
help='Name of applet',
type=str)
parser.add_argument(
'--description',
help='Description of applet',
type=str)
parser.add_argument(
'--categories',
help='Categories the applet belongs to',
type=str,
nargs="+")
args = parser.parse_args()
tator.util.update_applet(
host=args.host,
token=args.token,
applet_id=args.applet_id,
html_file=args.html_file,
applet_name=args.name,
categories=args.categories,
description=args.description)
if __name__ == "__main__":
main()