-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.py
59 lines (50 loc) · 1.36 KB
/
run.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
import argparse
from typing import Protocol
from routine_butler.main import main
class RunArgs(Protocol):
single_user: bool
testing: bool
native: bool
fullscreen: bool
open_browser: bool
reload: bool
CLI_DESCRIPTION = "CLI for running RoutineButler"
ARGS = [
{
"arg": "--single-user",
"help": "Runs the app w/ no login screen and a single user",
},
{
"arg": "--testing",
"help": "Runs the app in testing mode",
},
{
"arg": "--native",
"help": "Runs in a native window",
},
{
"arg": "--fullscreen",
"help": "Runs in fullscreen mode, only works w/ --native",
},
{
"arg": "--open-browser",
"help": "Auto-opens browser on startup, not applicable w/ --native",
},
{
"arg": "--reload",
"help": "Reloads the app on file changes (useful for development)",
},
]
if __name__ in {"__main__", "__mp_main__"}:
parser = argparse.ArgumentParser(description=CLI_DESCRIPTION)
for arg in ARGS:
parser.add_argument(arg["arg"], action="store_true", help=arg["help"])
args: RunArgs = parser.parse_args()
main(
testing=args.testing,
single_user=args.single_user,
native=args.native,
fullscreen=args.fullscreen,
open_browser=args.open_browser,
reload=args.reload,
)