26 lines
758 B
Python
26 lines
758 B
Python
from typing import AnyStr, Generator, Any
|
|
|
|
class Time:
|
|
def __init__(self, hour: int, minute: int) -> None:
|
|
self.hour: int = hour
|
|
self.minute: int = minute
|
|
|
|
class Event:
|
|
"""
|
|
*weekdays: list[int] -> select weekdays from 0 to 6\n
|
|
*time: list[Time] -> select time to activate event\n
|
|
*sleep: int -> amount of seconds how much thread will be blocked after event\n
|
|
@staticmethod execute() -> this will be called on event
|
|
"""
|
|
weekdays: list[int]
|
|
time: list[Time]
|
|
sleep: int
|
|
|
|
@staticmethod
|
|
def execute() -> Any | AnyStr | str:
|
|
...
|
|
|
|
|
|
__EVENTLIST: list[Event] = []
|
|
def addEvent(event: type[Event]): __EVENTLIST.append(event) # type: ignore
|
|
def getEvents() -> list[Event]: return __EVENTLIST
|