From 72b73be2990d3fe133bd64ce65b7a4bd352e798a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Fri, 5 Aug 2022 20:26:12 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20=E4=BF=AE=E5=A4=8D=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E6=97=B6=E4=BD=BF=E7=94=A8=E4=BA=86=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E5=8C=85=E8=B7=AF=E5=BE=84=E5=BC=95=E5=8F=91?= =?UTF-8?q?=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/admin/services.py | 4 ++-- main.py | 2 +- utils/apps/inject.py | 3 +-- utils/apps/manager.py | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/admin/services.py b/apps/admin/services.py index c59370f..e22e764 100644 --- a/apps/admin/services.py +++ b/apps/admin/services.py @@ -3,10 +3,10 @@ from typing import List from pymysql import IntegrityError from telegram import Bot -from cache import BotAdminCache, GroupAdminCache from config import config from logger import Log -from repositories import BotAdminRepository +from .cache import BotAdminCache, GroupAdminCache +from .repositories import BotAdminRepository class BotAdminService: diff --git a/main.py b/main.py index 5f391b5..16a8b59 100644 --- a/main.py +++ b/main.py @@ -4,11 +4,11 @@ from warnings import filterwarnings import pytz from telegram.ext import Application, Defaults from telegram.warnings import PTBUserWarning -from utils.app.manager import AppsManager from config import config from logger import Log from utils.aiobrowser import AioBrowser +from utils.apps.manager import AppsManager from utils.job.register import register_job from utils.mysql import MySQL from utils.plugins.register import register_plugin_handlers diff --git a/utils/apps/inject.py b/utils/apps/inject.py index a2f323d..4000ec6 100644 --- a/utils/apps/inject.py +++ b/utils/apps/inject.py @@ -1,10 +1,9 @@ import inspect from functools import wraps -from utils.app.manager import ServiceDict - from logger import Log from models.types import Func +from utils.apps.manager import ServiceDict def get_injections(func: Func): diff --git a/utils/apps/manager.py b/utils/apps/manager.py index 2561e71..b657086 100644 --- a/utils/apps/manager.py +++ b/utils/apps/manager.py @@ -54,7 +54,7 @@ class AppsManager: for app_name in self.app_list: if app_name not in self.exclude_list: try: - import_module(f"app.{app_name}") + import_module(f"apps.{app_name}") except ImportError as exc: Log.warning(f"Service模块 {app_name} 导入失败", exc) except ImportWarning as exc: