diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/responses/libnotify.py | 4 | ||||
-rw-r--r-- | modules/responses/responses.py | 16 |
2 files changed, 8 insertions, 12 deletions
diff --git a/modules/responses/libnotify.py b/modules/responses/libnotify.py new file mode 100644 index 0000000..2e83101 --- /dev/null +++ b/modules/responses/libnotify.py @@ -0,0 +1,4 @@ +import os + +def respond(text: str) -> None: + os.popen(f'notify-send Hestia "{text}" --app-name=hestia')
\ No newline at end of file diff --git a/modules/responses/responses.py b/modules/responses/responses.py index 1836deb..f89a1fe 100644 --- a/modules/responses/responses.py +++ b/modules/responses/responses.py @@ -2,13 +2,9 @@ from dataclasses import dataclass, field from typing import List, Dict, Any @dataclass(frozen=True) -class ResponseData: - sentence_texts: List[str] - -@dataclass(frozen=True) class Response: name: str - data: List[ResponseData] = field(default_factory=list) + sentence_texts: List[str] @dataclass(frozen=True) class Responses: @@ -25,13 +21,9 @@ class Responses: responses={ response_name: Response( name=response_name, - data=[ - ResponseData( - sentence_texts=data_dict["sentences"], - ) - for data_dict in response_dict["data"] - ], + sentence_texts=response_dict["sentences"] ) for response_name, response_dict in input_dict["responses"].items() }, - )
\ No newline at end of file + ) + |