This commit is contained in:
恍兮惚兮 2024-11-15 01:33:17 +08:00
parent dc660fd28a
commit d8346dabdd
4 changed files with 29 additions and 23 deletions

View File

@ -10,7 +10,7 @@ if not rootDir:
else: else:
rootDir = os.path.abspath(rootDir) rootDir = os.path.abspath(rootDir)
rootthisfiledir = rootDir rootthisfiledir = rootDir
rootDir=os.path.abspath(os.path.join(rootDir,'../../py')) rootDir = os.path.abspath(os.path.join(rootDir, "../../py"))
if sys.argv[1] == "loadversion": if sys.argv[1] == "loadversion":
os.chdir(rootDir) os.chdir(rootDir)
with open("../cpp/version.cmake", "r", encoding="utf8") as ff: with open("../cpp/version.cmake", "r", encoding="utf8") as ff:
@ -193,6 +193,7 @@ def get_url_as_json(url):
except: except:
time.sleep(3) time.sleep(3)
def buildPlugins(arch): def buildPlugins(arch):
os.chdir(rootDir + "\\..\\cpp\\scripts") os.chdir(rootDir + "\\..\\cpp\\scripts")
subprocess.run("python fetchwebview2.py") subprocess.run("python fetchwebview2.py")
@ -215,10 +216,7 @@ def buildPlugins(arch):
def downloadsomething(): def downloadsomething():
os.chdir(rootDir + "\\temp") shutil.rmtree(rootDir + "\\files\\LunaTranslator_qss\\.git")
subprocess.run(f"curl -LO {mylinks['themes.zip']}")
subprocess.run(f"7z x themes.zip -oALL")
move_directory_contents("ALL/themes", rootDir + "\\files\\themes")
def downloadbass(): def downloadbass():
@ -260,7 +258,9 @@ if __name__ == "__main__":
shutil.rmtree(os.path.join(os.path.dirname(py37Path), "Lib\\test")) shutil.rmtree(os.path.join(os.path.dirname(py37Path), "Lib\\test"))
shutil.rmtree(os.path.join(os.path.dirname(py37Path), "Lib\\unittest")) shutil.rmtree(os.path.join(os.path.dirname(py37Path), "Lib\\unittest"))
# 放弃3.8需要安装KB2533623才能运行3.7用不着。 # 放弃3.8需要安装KB2533623才能运行3.7用不着。
subprocess.run(f"{py37Path} {os.path.join(rootthisfiledir,'collectpyruntime.py')}") subprocess.run(
f"{py37Path} {os.path.join(rootthisfiledir,'collectpyruntime.py')}"
)
elif sys.argv[1] == "merge": elif sys.argv[1] == "merge":
createPluginDirs() createPluginDirs()
downloadsomething() downloadsomething()
@ -294,19 +294,23 @@ if __name__ == "__main__":
) )
os.chdir(rootDir + "/../cpp/scripts") os.chdir(rootDir + "/../cpp/scripts")
os.makedirs('../../py/files/plugins/DLL32',exist_ok=True) os.makedirs("../../py/files/plugins/DLL32", exist_ok=True)
shutil.copy('../builds/_x86/shareddllproxy32.exe','../../py/files/plugins') shutil.copy("../builds/_x86/shareddllproxy32.exe", "../../py/files/plugins")
shutil.copy('../builds/_x86/winrtutils32.dll','../../py/files/plugins/DLL32') shutil.copy("../builds/_x86/winrtutils32.dll", "../../py/files/plugins/DLL32")
shutil.copy('../builds/_x86/winsharedutils32.dll','../../py/files/plugins/DLL32') shutil.copy(
shutil.copy('../builds/_x86/wcocr.dll','../../py/files/plugins/DLL32') "../builds/_x86/winsharedutils32.dll", "../../py/files/plugins/DLL32"
shutil.copy('../builds/_x86/LunaOCR32.dll','../../py/files/plugins/DLL32') )
os.makedirs('../../py/files/plugins/DLL64',exist_ok=True) shutil.copy("../builds/_x86/wcocr.dll", "../../py/files/plugins/DLL32")
shutil.copy('../builds/_x64/shareddllproxy64.exe','../../py/files/plugins') shutil.copy("../builds/_x86/LunaOCR32.dll", "../../py/files/plugins/DLL32")
shutil.copy('../builds/_x64/hookmagpie.dll','../../py/files/plugins') os.makedirs("../../py/files/plugins/DLL64", exist_ok=True)
shutil.copy('../builds/_x64/winrtutils64.dll','../../py/files/plugins/DLL64') shutil.copy("../builds/_x64/shareddllproxy64.exe", "../../py/files/plugins")
shutil.copy('../builds/_x64/winsharedutils64.dll','../../py/files/plugins/DLL64') shutil.copy("../builds/_x64/hookmagpie.dll", "../../py/files/plugins")
shutil.copy('../builds/_x64/wcocr.dll','../../py/files/plugins/DLL64') shutil.copy("../builds/_x64/winrtutils64.dll", "../../py/files/plugins/DLL64")
shutil.copy('../builds/_x64/LunaOCR64.dll','../../py/files/plugins/DLL64') shutil.copy(
"../builds/_x64/winsharedutils64.dll", "../../py/files/plugins/DLL64"
)
shutil.copy("../builds/_x64/wcocr.dll", "../../py/files/plugins/DLL64")
shutil.copy("../builds/_x64/LunaOCR64.dll", "../../py/files/plugins/DLL64")
if arch == "x86": if arch == "x86":
os.chdir(rootDir) os.chdir(rootDir)

View File

@ -73,6 +73,8 @@ jobs:
fname: LunaTranslator fname: LunaTranslator
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- run: git submodule init py/files/LunaTranslator_qss
- run: git submodule update py/files/LunaTranslator_qss
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v4
with: with:
path: build path: build

View File

@ -1026,11 +1026,11 @@ class MAINUI:
if _fn.endswith(".py"): if _fn.endswith(".py"):
style = importlib.import_module( style = importlib.import_module(
"files.themes." + _fn[:-3].replace("/", ".") "files.LunaTranslator_qss." + _fn[:-3].replace("/", ".")
).stylesheet() ).stylesheet()
elif _fn.endswith(".qss"): elif _fn.endswith(".qss"):
with open( with open(
"./files/themes/{}".format(_fn), "./files/LunaTranslator_qss/{}".format(_fn),
"r", "r",
) as ff: ) as ff:
style = ff.read() style = ff.read()