Draft pyauto

This commit is contained in:
Changhua
2023-10-07 15:29:50 +08:00
parent 0df5d27e5a
commit df9557cce8
19 changed files with 66 additions and 1077 deletions
+33
View File
@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
import asyncio
import logging
from abc import abstractmethod
class Event(object):
_message_callback_func = {}
_message_callback_func_list = []
_loop = asyncio.get_event_loop()
def __init__(self):
super(Event, self).__init__()
self._message = None
self._logger: logging = logging.getLogger()
@abstractmethod
def _add_callback(self, func, *args, **kwargs):
"""
消息处理函数加载器
:param func: 消息处理函数
:param args: 消息处理函数参数
:param kwargs: 消息处理函数参数
"""
raise NotImplementedError
@abstractmethod
def _run_func(self):
"""
消息分发器, 将消息发送给所有消息处理函数
"""
raise NotImplementedError