From b4e0034876d7eeb8a9be65e4444a01eaa2003ddf Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sat, 10 Oct 2020 23:40:01 +0800 Subject: [PATCH] :bulb: add driver docstring --- nonebot/drivers/__init__.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nonebot/drivers/__init__.py b/nonebot/drivers/__init__.py index af8587d1..396622ed 100644 --- a/nonebot/drivers/__init__.py +++ b/nonebot/drivers/__init__.py @@ -1,5 +1,11 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +""" +后端驱动适配基类 +=============== + +各驱动请继承以下基类 +""" import abc @@ -9,7 +15,15 @@ from nonebot.typing import Bot, Dict, Type, Union, Optional, Callable class BaseDriver(abc.ABC): + """ + Driver 基类。将后端框架封装,以满足适配器使用。 + """ + _adapters: Dict[str, Type[Bot]] = {} + """ + :类型: ``Dict[str, Type[Bot]]`` + :说明: 已注册的适配器列表 + """ @abc.abstractmethod def __init__(self, env: Env, config: Config):