-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
44 lines (35 loc) · 1.04 KB
/
main.py
File metadata and controls
44 lines (35 loc) · 1.04 KB
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
import argparse
from project import Project
from user import User
def main():
USER_NAME = "user"
user = User(USER_NAME)
parser = argparse.ArgumentParser()
parser.add_argument(
"mode",
type=str,
help="Run mode. Now supports start, stop, pause, unpause, stats, switch.",
)
args = parser.parse_args()
mode = args.mode
if mode == "switch":
project_name = input(
"Enter an existing project to set as the default, or name a new project name to set it up: "
)
user.update_default_project(project_name)
return
project = Project(user.default_project, user.projects_path, user.sessions_path)
if mode == "start":
project.start()
elif mode == "stop":
project.stop()
elif mode == "pause":
project.pause()
elif mode == "unpause":
project.unpause()
elif mode == "stats":
project.stats()
else:
raise NotImplementedError(f"Run mode {mode} is not supported!")
if __name__ == "__main__":
main()