mirror of
https://github.com/onyx-and-iris/simple-recorder.git
synced 2025-06-27 09:50:23 +01:00
fix bug with parser (regression)
patch bump
This commit is contained in:
parent
bba2361964
commit
68041f1406
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "simple-recorder"
|
name = "simple-recorder"
|
||||||
version = "0.1.5"
|
version = "0.1.6"
|
||||||
description = "A simple OBS recorder"
|
description = "A simple OBS recorder"
|
||||||
authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }]
|
authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
@ -47,10 +47,18 @@ class SimpleRecorder(Command):
|
|||||||
env="OBS_THEME",
|
env="OBS_THEME",
|
||||||
help=f"GUI theme ({', '.join(themes)})",
|
help=f"GUI theme ({', '.join(themes)})",
|
||||||
)
|
)
|
||||||
|
debug: bool = arg(
|
||||||
|
default=False,
|
||||||
|
env="DEBUG",
|
||||||
|
help="Enable debug logging",
|
||||||
|
)
|
||||||
|
|
||||||
@override
|
@override
|
||||||
async def run(self):
|
async def run(self):
|
||||||
"""Run the Simple Recorder GUI."""
|
"""Run the Simple Recorder GUI."""
|
||||||
|
if self.debug:
|
||||||
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
|
|
||||||
window = SimpleRecorderWindow(self.host, self.port, self.password, self.theme)
|
window = SimpleRecorderWindow(self.host, self.port, self.password, self.theme)
|
||||||
await window.run()
|
await window.run()
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
import FreeSimpleGUI as fsg
|
import FreeSimpleGUI as fsg
|
||||||
from clypi import ClypiException
|
|
||||||
|
|
||||||
|
from .errors import SimpleRecorderError
|
||||||
from .start import Start
|
from .start import Start
|
||||||
from .stop import Stop
|
from .stop import Stop
|
||||||
|
|
||||||
@ -31,11 +31,12 @@ class SimpleRecorderWindow(fsg.Window):
|
|||||||
async def run(self):
|
async def run(self):
|
||||||
while True:
|
while True:
|
||||||
event, values = self.read()
|
event, values = self.read()
|
||||||
|
self.logger.debug(f"Event: {event}, Values: {values}")
|
||||||
if event == fsg.WIN_CLOSED:
|
if event == fsg.WIN_CLOSED:
|
||||||
break
|
break
|
||||||
|
|
||||||
match event.split(" || "):
|
match e := event.split(" || "):
|
||||||
case ["Start Recording", "RETURN" | None] | ["-FILENAME-", "RETURN"]:
|
case ["Start Recording"] | ["Start Recording" | "-FILENAME-", "RETURN"]:
|
||||||
try:
|
try:
|
||||||
await Start(
|
await Start(
|
||||||
filename=values["-FILENAME-"],
|
filename=values["-FILENAME-"],
|
||||||
@ -46,12 +47,12 @@ class SimpleRecorderWindow(fsg.Window):
|
|||||||
self["-OUTPUT-"].update(
|
self["-OUTPUT-"].update(
|
||||||
"Recording started successfully", text_color="green"
|
"Recording started successfully", text_color="green"
|
||||||
)
|
)
|
||||||
except ClypiException as e:
|
except SimpleRecorderError as e:
|
||||||
self["-OUTPUT-"].update(
|
self["-OUTPUT-"].update(
|
||||||
f"Error: {e.raw_message}", text_color="red"
|
f"Error: {e.raw_message}", text_color="red"
|
||||||
)
|
)
|
||||||
|
|
||||||
case ["Stop Recording", "RETURN" | None]:
|
case ["Stop Recording"] | ["Stop Recording", "RETURN"]:
|
||||||
try:
|
try:
|
||||||
await Stop(
|
await Stop(
|
||||||
host=self.host, port=self.port, password=self.password
|
host=self.host, port=self.port, password=self.password
|
||||||
@ -59,12 +60,12 @@ class SimpleRecorderWindow(fsg.Window):
|
|||||||
self["-OUTPUT-"].update(
|
self["-OUTPUT-"].update(
|
||||||
"Recording stopped successfully", text_color="green"
|
"Recording stopped successfully", text_color="green"
|
||||||
)
|
)
|
||||||
except ClypiException as e:
|
except SimpleRecorderError as e:
|
||||||
self["-OUTPUT-"].update(
|
self["-OUTPUT-"].update(
|
||||||
f"Error: {e.raw_message}", text_color="red"
|
f"Error: {e.raw_message}", text_color="red"
|
||||||
)
|
)
|
||||||
|
|
||||||
case _:
|
case _:
|
||||||
self.logger.warning(f"Unhandled event: {event}")
|
self.logger.warning(f"Unhandled event: {e}")
|
||||||
|
|
||||||
self.close()
|
self.close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user