Skip to content

Commit

Permalink
feat: 为大多数模块添加 __all__ 属性
Browse files Browse the repository at this point in the history
  • Loading branch information
st1020 committed Apr 20, 2022
1 parent fcf96ee commit d58ad7e
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions alicebot/adapter/__init__.py
Expand Up @@ -17,6 +17,8 @@
from alicebot import Bot
from alicebot.event import T_Event

__all__ = ['T_Adapter', 'BaseAdapter', 'Adapter']

T_Adapter = TypeVar('T_Adapter', bound='BaseAdapter')

if os.getenv('ALICEBOT_DEV') == '1':
Expand Down
2 changes: 2 additions & 0 deletions alicebot/config.py
Expand Up @@ -6,6 +6,8 @@

from pydantic import BaseModel

__all__ = ['MainConfig']


class MainConfig(BaseModel):
"""AliceBot 的主要配置。
Expand Down
2 changes: 2 additions & 0 deletions alicebot/event/__init__.py
Expand Up @@ -9,6 +9,8 @@

from alicebot.message import Message, DataclassEncoder

__all__ = ['T_Event', 'Event']

T_Event = TypeVar('T_Event', bound='Event')


Expand Down
2 changes: 2 additions & 0 deletions alicebot/plugin/__init__.py
Expand Up @@ -13,6 +13,8 @@
from alicebot.config import MainConfig
from alicebot.adapter import T_Adapter

__all__ = ['T_Plugin', 'Plugin']

T_Plugin = TypeVar('T_Plugin', bound='Plugin')


Expand Down
2 changes: 2 additions & 0 deletions alicebot/utils.py
Expand Up @@ -15,6 +15,8 @@
if TYPE_CHECKING:
from pkgutil import ModuleInfo

__all__ = ['Condition', 'ModulePathFinder', 'load_module', 'load_modules_from_dir']

_T = TypeVar('_T')


Expand Down
Expand Up @@ -21,6 +21,8 @@
from alicebot.plugin import T_Plugin
from apscheduler.job import Job

__all__ = ['APSchedulerAdapter', 'scheduler_decorator']


class APSchedulerAdapter(BaseAdapter):
name: str = 'apscheduler'
Expand Down
Expand Up @@ -26,6 +26,8 @@
if TYPE_CHECKING:
from .message import CQHTTPMessageSegment

__all__ = ['CQHTTPAdapter']


class CQHTTPAdapter(Adapter):
"""CQHTTP 协议适配器。
Expand Down
Expand Up @@ -20,6 +20,8 @@
from .message import DingTalkMessage
from .exceptions import ApiTimeout, NetworkError

__all__ = ['DingTalkAdapter']


class DingTalkAdapter(Adapter):
"""钉钉协议适配器。"""
Expand Down
Expand Up @@ -28,6 +28,8 @@
from .event import T_MiraiEvent
from .message import MiraiMessageSegment

__all__ = ['MiraiAdapter']


class MiraiAdapter(Adapter):
"""Mirai 协议适配器。
Expand Down

0 comments on commit d58ad7e

Please sign in to comment.