From 9a06f0c0afd333b27ee0fb6228b4b685736929d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Thu, 6 Jun 2024 19:56:23 +0800 Subject: [PATCH] dev --- .../LunaTranslator/gui/setting_translate.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/setting_translate.py b/LunaTranslator/LunaTranslator/gui/setting_translate.py index 4eded28c..82519254 100644 --- a/LunaTranslator/LunaTranslator/gui/setting_translate.py +++ b/LunaTranslator/LunaTranslator/gui/setting_translate.py @@ -129,9 +129,18 @@ def checkconnected(self): if os.path.exists(syspath) and os.path.isfile(syspath): _path = syspath break - needstart = ( - any([globalconfig["fanyi"][dev]["use"] for dev in develop]) and _path - ) + needstart = False + for dev in develop: + if not globalconfig["fanyi"][dev]["use"]: + continue + if dev == "selfbuild": + if not os.path.exists("./userconfig/selfbuild.py"): + continue + else: + if not os.path.exists("./LunaTranslator/translator/" + dev + ".py"): + continue + needstart = True + break try: if needstart: