-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathsession_cmd.py
More file actions
39 lines (29 loc) · 769 Bytes
/
session_cmd.py
File metadata and controls
39 lines (29 loc) · 769 Bytes
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
"""Session management commands."""
import click
from kwave.cli.main import pass_session
from kwave.cli.schema import CLIResponse, json_command
@click.group("session")
def session():
"""Manage simulation session."""
pass
@session.command()
@pass_session
@json_command("session.init")
def init(sess):
"""Create a new session."""
info = sess.init()
return CLIResponse(result=info)
@session.command()
@pass_session
@json_command("session.status")
def status(sess):
"""Return full current session state."""
sess.load()
return CLIResponse(result=sess.status())
@session.command()
@pass_session
@json_command("session.reset")
def reset(sess):
"""Clear session state."""
info = sess.reset()
return CLIResponse(result=info)