当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 1 Fork 0

cxykevin/dashedgeless
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
on_start.py 1.50 KB
一键复制 编辑 原始数据 按行查看 历史
cxykevin 提交于 2023-07-02 21:54 . 环境变量修复
# coding: utf-8
import dashloader
import config
import os, sys
import time
import tools
from concurrent.futures import ProcessPoolExecutor, wait, ALL_COMPLETED
from multiprocessing import freeze_support
pluglist = dashloader.get_cache_list()
if __name__ == "__main__":
freeze_support()
tools.log("[INFO path]" + "set dash path")
os.system("pecmd setpath.wcs")
time.sleep(1)
config.HookInStart()
if not os.path.exists(config.CACHE_PATH):
tools.log("[INFO cache]" + "make cache dir")
os.mkdir(config.CACHE_PATH)
if dashloader.config.THEARD_NUM == 0:
tools.log("[INFO start]" + "(single thread) start load")
for i in pluglist:
dashloader.load_plugin(i)
else:
plist = dashloader.get_cache_list()
tools.log("[INFO start]" + "start load")
with ProcessPoolExecutor(max_workers=config.THEARD_NUM) as t:
for i in range(config.THEARD_NUM):
tools.log("[INFO theard]" + "start theard " + str(i))
t.submit(
dashloader.load_plugin_theard,
i,
[plist[j] for j in range(i, len(plist), config.THEARD_NUM)],
)
t.shutdown()
if config.DISABLE_CACHE:
sys.exit(0)
time.sleep(3)
tools.log("[INFO start]" + "load plugin finished")
dashloader.set_icon()
config.HookInFinish()
tools.log("[INFO start]" + "fix icon finished")
time.sleep(6)
dashloader.caches()
config.HookInCache()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/cxy_kevin/dashedgeless.git
git@gitee.com:cxy_kevin/dashedgeless.git
cxy_kevin
dashedgeless
dashedgeless
master

搜索帮助