diff --git a/src/earwigbot/bot.py b/src/earwigbot/bot.py index 16de45c..ee8606c 100644 --- a/src/earwigbot/bot.py +++ b/src/earwigbot/bot.py @@ -18,6 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +__all__ = ["Bot"] + import logging from threading import Lock, Thread from threading import enumerate as enumerate_threads @@ -29,8 +31,6 @@ from earwigbot.irc import Frontend, Watcher from earwigbot.managers import CommandManager, TaskManager from earwigbot.wiki import SitesDB -__all__ = ["Bot"] - class Bot: """ diff --git a/src/earwigbot/cli.py b/src/earwigbot/cli.py index f89c4f9..21fd836 100755 --- a/src/earwigbot/cli.py +++ b/src/earwigbot/cli.py @@ -47,6 +47,8 @@ or run specific tasks. """ +__all__ = ["main"] + import logging from argparse import REMAINDER, Action, ArgumentParser from os import path @@ -55,8 +57,6 @@ from time import sleep from earwigbot import __version__ from earwigbot.bot import Bot -__all__ = ["main"] - class _StoreTaskArg(Action): """A custom argparse action to read remaining command-line arguments.""" diff --git a/src/earwigbot/config/__init__.py b/src/earwigbot/config/__init__.py index 24f794b..1010490 100644 --- a/src/earwigbot/config/__init__.py +++ b/src/earwigbot/config/__init__.py @@ -18,6 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +__all__ = ["BotConfig"] + import base64 import logging import logging.handlers @@ -34,8 +36,6 @@ from earwigbot.config.permissions import PermissionsDB from earwigbot.config.script import ConfigScript from earwigbot.exceptions import NoConfigError -__all__ = ["BotConfig"] - class BotConfig: """ diff --git a/src/earwigbot/config/formatter.py b/src/earwigbot/config/formatter.py index 79b2522..7a5f7c8 100644 --- a/src/earwigbot/config/formatter.py +++ b/src/earwigbot/config/formatter.py @@ -18,10 +18,10 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -import logging - __all__ = ["BotFormatter"] +import logging + class BotFormatter(logging.Formatter): def __init__(self, color=False): diff --git a/src/earwigbot/config/node.py b/src/earwigbot/config/node.py index a308add..3360f01 100644 --- a/src/earwigbot/config/node.py +++ b/src/earwigbot/config/node.py @@ -18,10 +18,10 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -import base64 - __all__ = ["ConfigNode"] +import base64 + class ConfigNode: def __init__(self): diff --git a/src/earwigbot/config/permissions.py b/src/earwigbot/config/permissions.py index 188d5f0..eb1fe85 100644 --- a/src/earwigbot/config/permissions.py +++ b/src/earwigbot/config/permissions.py @@ -18,12 +18,12 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +__all__ = ["PermissionsDB"] + import sqlite3 as sqlite from fnmatch import fnmatch from threading import Lock -__all__ = ["PermissionsDB"] - class PermissionsDB: """ diff --git a/src/earwigbot/config/script.py b/src/earwigbot/config/script.py index 21dfcef..8a84905 100644 --- a/src/earwigbot/config/script.py +++ b/src/earwigbot/config/script.py @@ -18,6 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +__all__ = ["ConfigScript"] + import base64 import getpass import os @@ -33,8 +35,6 @@ import yaml from earwigbot import exceptions -__all__ = ["ConfigScript"] - RULES_TEMPLATE = """\ from earwigbot.bot import Bot from earwigbot.irc import RC diff --git a/src/earwigbot/irc/watcher.py b/src/earwigbot/irc/watcher.py index 013a49b..762266f 100644 --- a/src/earwigbot/irc/watcher.py +++ b/src/earwigbot/irc/watcher.py @@ -18,13 +18,13 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +__all__ = ["Watcher"] + import importlib.machinery import importlib.util from earwigbot.irc import RC, IRCConnection -__all__ = ["Watcher"] - class Watcher(IRCConnection): """ diff --git a/src/earwigbot/managers.py b/src/earwigbot/managers.py index a1387a5..27bbea8 100644 --- a/src/earwigbot/managers.py +++ b/src/earwigbot/managers.py @@ -19,6 +19,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +__all__ = ["CommandManager", "TaskManager"] + import importlib.machinery import importlib.util from os import listdir, path @@ -29,8 +31,6 @@ from time import gmtime, strftime from earwigbot.commands import Command from earwigbot.tasks import Task -__all__ = ["CommandManager", "TaskManager"] - class _ResourceManager: """ diff --git a/src/earwigbot/tasks/__init__.py b/src/earwigbot/tasks/__init__.py index b6a6d2c..b88b7d3 100644 --- a/src/earwigbot/tasks/__init__.py +++ b/src/earwigbot/tasks/__init__.py @@ -18,12 +18,12 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +__all__ = ["Task"] + from typing import Any from earwigbot import exceptions -__all__ = ["Task"] - class Task: """ diff --git a/src/earwigbot/wiki/category.py b/src/earwigbot/wiki/category.py index 02184b3..674879b 100644 --- a/src/earwigbot/wiki/category.py +++ b/src/earwigbot/wiki/category.py @@ -18,13 +18,13 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +__all__ = ["Category"] + from collections.abc import Iterator from earwigbot.wiki.constants import Service from earwigbot.wiki.page import Page -__all__ = ["Category"] - class Category(Page): """ diff --git a/src/earwigbot/wiki/page.py b/src/earwigbot/wiki/page.py index 947fd1b..23edce3 100644 --- a/src/earwigbot/wiki/page.py +++ b/src/earwigbot/wiki/page.py @@ -20,6 +20,8 @@ from __future__ import annotations +__all__ = ["Page"] + import hashlib import re import time @@ -39,8 +41,6 @@ if typing.TYPE_CHECKING: from earwigbot.wiki.site import Site from earwigbot.wiki.user import User -__all__ = ["Page"] - class Page(CopyvioMixIn): """ diff --git a/src/earwigbot/wiki/site.py b/src/earwigbot/wiki/site.py index cdb5f62..75f2a3d 100644 --- a/src/earwigbot/wiki/site.py +++ b/src/earwigbot/wiki/site.py @@ -20,6 +20,8 @@ from __future__ import annotations +__all__ = ["Site"] + import json import os.path import time @@ -53,8 +55,6 @@ else: except ModuleNotFoundError: pymysql = None -__all__ = ["Site"] - T = TypeVar("T") P = ParamSpec("P") diff --git a/src/earwigbot/wiki/sitesdb.py b/src/earwigbot/wiki/sitesdb.py index 91e8072..eb0fe76 100644 --- a/src/earwigbot/wiki/sitesdb.py +++ b/src/earwigbot/wiki/sitesdb.py @@ -20,6 +20,8 @@ from __future__ import annotations +__all__ = ["SitesDB"] + import errno import sqlite3 as sqlite import stat @@ -38,8 +40,6 @@ from earwigbot.wiki.site import Site, SqlConnInfo if typing.TYPE_CHECKING: from earwigbot.bot import Bot -__all__ = ["SitesDB"] - @dataclass(frozen=True) class _SiteInfoFromDB: diff --git a/src/earwigbot/wiki/user.py b/src/earwigbot/wiki/user.py index 89e2853..6ac80d4 100644 --- a/src/earwigbot/wiki/user.py +++ b/src/earwigbot/wiki/user.py @@ -20,6 +20,8 @@ from __future__ import annotations +__all__ = ["User"] + import socket import time import typing @@ -33,8 +35,6 @@ from earwigbot.wiki.page import Page if typing.TYPE_CHECKING: from earwigbot.wiki.site import Site -__all__ = ["User"] - class User: """