Improve pyotherside_events.py doc

This commit is contained in:
miruka 2019-12-18 10:39:25 -04:00
parent d89c83af5b
commit 05a331382e
2 changed files with 8 additions and 5 deletions

View File

@ -32,6 +32,7 @@
## Refactoring
- Coroutine future OR document uuid
- Account settings with `HTabbedContainer`
- Get rid of all `currentSpacing` stuff
- Use new default/reset controls system

View File

@ -9,10 +9,11 @@ from .utils import serialize_value_for_qml
@dataclass
class PyOtherSideEvent:
"""Event that will be sent to QML by PyOtherSide."""
"""Event that will be sent on instanciation to QML by PyOtherSide."""
def __post_init__(self) -> None:
# CPython >= 3.6 or any Python >= 3.7 needed for correct dict order
# CPython 3.6 or any Python implemention >= 3.7 is required for correct
# __dataclass_fields__ dict order.
args = [
serialize_value_for_qml(getattr(self, field))
for field in self.__dataclass_fields__ # type: ignore
@ -29,9 +30,10 @@ class ExitRequested(PyOtherSideEvent):
@dataclass
class AlertRequested(PyOtherSideEvent):
"""Request an alert to be shown for msec milliseconds.
The Alert state for example sets the urgency hint on X11/Wayland,
or flashes the taskbar icon on Windows.
"""Request a window manager alert to be shown.
Sets the urgency hint for compliant X11/Wayland window managers;
flashes the taskbar icon on Windows.
"""