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 ## Refactoring
- Coroutine future OR document uuid
- Account settings with `HTabbedContainer` - Account settings with `HTabbedContainer`
- Get rid of all `currentSpacing` stuff - Get rid of all `currentSpacing` stuff
- Use new default/reset controls system - Use new default/reset controls system

View File

@ -9,10 +9,11 @@ from .utils import serialize_value_for_qml
@dataclass @dataclass
class PyOtherSideEvent: 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: 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 = [ args = [
serialize_value_for_qml(getattr(self, field)) serialize_value_for_qml(getattr(self, field))
for field in self.__dataclass_fields__ # type: ignore for field in self.__dataclass_fields__ # type: ignore
@ -29,9 +30,10 @@ class ExitRequested(PyOtherSideEvent):
@dataclass @dataclass
class AlertRequested(PyOtherSideEvent): class AlertRequested(PyOtherSideEvent):
"""Request an alert to be shown for msec milliseconds. """Request a window manager alert to be shown.
The Alert state for example sets the urgency hint on X11/Wayland,
or flashes the taskbar icon on Windows. Sets the urgency hint for compliant X11/Wayland window managers;
flashes the taskbar icon on Windows.
""" """