🔧 修复初始化时使用了错误的包路径引发的错误

This commit is contained in:
洛水居室 2022-08-05 20:26:12 +08:00
parent 4e696eddad
commit 72b73be299
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC
4 changed files with 5 additions and 6 deletions

View File

@ -3,10 +3,10 @@ from typing import List
from pymysql import IntegrityError from pymysql import IntegrityError
from telegram import Bot from telegram import Bot
from cache import BotAdminCache, GroupAdminCache
from config import config from config import config
from logger import Log from logger import Log
from repositories import BotAdminRepository from .cache import BotAdminCache, GroupAdminCache
from .repositories import BotAdminRepository
class BotAdminService: class BotAdminService:

View File

@ -4,11 +4,11 @@ from warnings import filterwarnings
import pytz import pytz
from telegram.ext import Application, Defaults from telegram.ext import Application, Defaults
from telegram.warnings import PTBUserWarning from telegram.warnings import PTBUserWarning
from utils.app.manager import AppsManager
from config import config from config import config
from logger import Log from logger import Log
from utils.aiobrowser import AioBrowser from utils.aiobrowser import AioBrowser
from utils.apps.manager import AppsManager
from utils.job.register import register_job from utils.job.register import register_job
from utils.mysql import MySQL from utils.mysql import MySQL
from utils.plugins.register import register_plugin_handlers from utils.plugins.register import register_plugin_handlers

View File

@ -1,10 +1,9 @@
import inspect import inspect
from functools import wraps from functools import wraps
from utils.app.manager import ServiceDict
from logger import Log from logger import Log
from models.types import Func from models.types import Func
from utils.apps.manager import ServiceDict
def get_injections(func: Func): def get_injections(func: Func):

View File

@ -54,7 +54,7 @@ class AppsManager:
for app_name in self.app_list: for app_name in self.app_list:
if app_name not in self.exclude_list: if app_name not in self.exclude_list:
try: try:
import_module(f"app.{app_name}") import_module(f"apps.{app_name}")
except ImportError as exc: except ImportError as exc:
Log.warning(f"Service模块 {app_name} 导入失败", exc) Log.warning(f"Service模块 {app_name} 导入失败", exc)
except ImportWarning as exc: except ImportWarning as exc: