粗略过一遍,修复一眼可见的问题

This commit is contained in:
hemengyang
2022-01-12 19:41:42 +08:00
parent ec06010298
commit 98deadb4d6
9 changed files with 30 additions and 69 deletions

View File

@ -113,9 +113,6 @@ class Driver(abc.ABC):
def run(self, *args, **kwargs):
"""
启动驱动框架
参数: *args
**kwargs
"""
logger.opt(colors=True).debug(
f"<g>Loaded adapters: {escape_tag(', '.join(self._adapters))}</g>"
@ -135,9 +132,8 @@ class Driver(abc.ABC):
"""
装饰一个函数使他在 bot 通过 WebSocket 连接成功时执行。
:函数参数:
bot: 当前连接上的 Bot 对象
参数:
bot: 当前连接上的 Bot 对象
"""
self._bot_connection_hook.add(func)
return func
@ -146,9 +142,8 @@ class Driver(abc.ABC):
"""
装饰一个函数使他在 bot 通过 WebSocket 连接断开时执行。
:函数参数:
bot: 当前连接上的 Bot 对象
参数:
bot: 当前连接上的 Bot 对象
"""
self._bot_disconnection_hook.add(func)
return func

View File

@ -3,10 +3,7 @@
本驱动同时支持服务端以及客户端连接
后端使用方法请参考: `FastAPI 文档`_
.. _FastAPI 文档:
https://fastapi.tiangolo.com/
后端使用方法请参考: [`FastAPI 文档`](https://fastapi.tiangolo.com/)
"""
import logging

View File

@ -1,10 +1,7 @@
"""
## Quart 驱动适配
后端使用方法请参考: `Quart 文档`_
.. _Quart 文档:
https://pgjones.gitlab.io/quart/index.html
后端使用方法请参考: [`Quart 文档`](https://pgjones.gitlab.io/quart/index.html)
"""
import asyncio
@ -139,16 +136,12 @@ class Driver(ReverseDriver):
@overrides(ReverseDriver)
def on_startup(self, func: _AsyncCallable) -> _AsyncCallable:
"""参考文档: `Startup and Shutdown`_
.. _Startup and Shutdown:
https://pgjones.gitlab.io/quart/how_to_guides/startup_shutdown.html
"""
"""参考文档: [`Startup and Shutdown`](https://pgjones.gitlab.io/quart/how_to_guides/startup_shutdown.html)"""
return self.server_app.before_serving(func) # type: ignore
@overrides(ReverseDriver)
def on_shutdown(self, func: _AsyncCallable) -> _AsyncCallable:
"""参考文档: `Startup and Shutdown`_"""
"""参考文档: [`Startup and Shutdown`](https://pgjones.gitlab.io/quart/how_to_guides/startup_shutdown.html)"""
return self.server_app.after_serving(func) # type: ignore
@overrides(ReverseDriver)