Skip to content

Commit ac35214

Browse files
committed
mockup listener
1 parent ccd0b0f commit ac35214

4 files changed

Lines changed: 12 additions & 8 deletions

File tree

recorder/__main__.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ def get_device_class(name: str):
6363
return DEVICE_CLASSES[name.lower()]
6464
except KeyError:
6565
raise RuntimeError(
66-
f'Invalid device class `{name}`. Available options: '
67-
f'{list(DEVICE_CLASSES.keys())}'
66+
f"Invalid device class `{name}`. Available options: "
67+
f"{list(DEVICE_CLASSES.keys())}"
6868
)
6969

7070

71-
@app.command(help='Display the available devices')
71+
@app.command(help="Display the available devices")
7272
def show(
7373
device_class: Optional[str] = DEVICE_CLASS_ARGUMENT,
7474
verbose: bool = VERBOSE_OPTION
@@ -109,7 +109,7 @@ def config_device_class(device: Device) -> dict:
109109
return choices
110110

111111

112-
@app.command(help='Create a configuration `yaml` file.')
112+
@app.command(help="Create a configuration `yaml` file.")
113113
def config(output: Path = DEFAULT_CONFIG_PATH_OPTION) -> dict:
114114
config = {}
115115
for name, device_class in DEVICE_CLASSES.items():
@@ -133,20 +133,20 @@ def get_config(path: Path = DEFAULT_CONFIG_PATH) -> dict:
133133
return Config.from_yaml(path)
134134

135135

136-
@app.command(help='Record data from the configured devices')
136+
@app.command(help="Record data from the configured devices")
137137
def record(
138138
seconds: int = typer.Argument(None, help="Number of seconds to record"),
139139
config_path: Optional[Path] = DEFAULT_CONFIG_PATH_OPTION,
140140
output_folder: Optional[Path] = DEFAULT_OUTPUT_FOLDER_OPTION,
141141
):
142142
config = get_config(config_path)
143143
recorder = Recorder(config, output_folder)
144-
if typer.confirm('Recording ready, start?', default=True):
144+
if typer.confirm("Recording ready, start?", default=True):
145145
output_folder = recorder(seconds=seconds)
146-
typer.echo(f'Recording finished, data saved to {output_folder}')
146+
typer.echo(f"Recording finished, data saved to {output_folder}")
147147

148148

149-
@app.command(help='Test device recording')
149+
@app.command(help="Test device recording")
150150
def test(
151151
device_class: Optional[str] = DEVICE_CLASS_ARGUMENT,
152152
device_id: Optional[int] = DEVICE_ID_ARGUMENT,
@@ -184,6 +184,9 @@ def test(
184184
recorder = Recorder(config, output_folder)
185185
output_folder = recorder(seconds=5)
186186

187+
@app.command(help='Listen to an external command to start recording')
188+
def listen(to: str):
189+
raise NotImplementedError(f"Listen to {to} is not implemented.")
187190

188191
def main():
189192
# Launch the command line application

recorder/listener/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
LISTENER_CLASSES = []

recorder/listener/listener.py

Whitespace-only changes.

recorder/listener/localhost.py

Whitespace-only changes.

0 commit comments

Comments
 (0)