mirror of
https://github.com/baiqwerdvd/ArknightsUID.git
synced 2025-05-05 03:23:45 +08:00
🐛 fix excel read error
This commit is contained in:
parent
83736dd44c
commit
3fae4b2747
@ -1,4 +1,3 @@
|
||||
import asyncio
|
||||
from pathlib import Path
|
||||
|
||||
from gsuid_core.bot import Bot
|
||||
@ -11,26 +10,22 @@ from ..utils.resource.download_all_resource import download_all_resource
|
||||
from .memoryStore import store
|
||||
from .constants import Excel
|
||||
|
||||
sv_download_config = SV('下载资源', pm=2)
|
||||
sv_download_config = SV("下载资源", pm=2)
|
||||
|
||||
|
||||
@sv_download_config.on_fullmatch(('下载全部资源')) # noqa: UP034
|
||||
@sv_download_config.on_fullmatch(("下载全部资源")) # noqa: UP034
|
||||
async def send_download_resource_msg(bot: Bot, ev: Event):
|
||||
await bot.send('正在开始下载~可能需要较久的时间!')
|
||||
await bot.send("正在开始下载~可能需要较久的时间!")
|
||||
im = await download_all_resource()
|
||||
await bot.send(im)
|
||||
|
||||
|
||||
async def startup():
|
||||
logger.info('[资源文件下载] 正在检查与下载缺失的资源文件, 可能需要较长时间, 请稍等')
|
||||
logger.info("[资源文件下载] 正在检查与下载缺失的资源文件, 可能需要较长时间, 请稍等")
|
||||
await download_all_resource()
|
||||
logger.info('[资源文件下载] 检查完毕, 正在加载 gamedata')
|
||||
logger.info("[资源文件下载] 检查完毕, 正在加载 gamedata")
|
||||
|
||||
tasks = []
|
||||
for file_path in Path(
|
||||
get_res_path(['ArknightsUID', 'resource', 'gamedata'])
|
||||
).rglob('*.json'):
|
||||
tasks.append(store.get_file(Path(file_path)))
|
||||
await asyncio.gather(*tasks)
|
||||
for file_path in Path(get_res_path(["ArknightsUID", "resource", "gamedata"])).rglob("*.json"):
|
||||
await store.get_file(file_path)
|
||||
|
||||
await Excel.preload_table()
|
||||
|
Loading…
x
Reference in New Issue
Block a user