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

@ -9,8 +9,8 @@ if not rootDir:
rootDir = os.path.abspath(".")
else:
rootDir = os.path.abspath(rootDir)
rootthisfiledir=rootDir
rootDir=os.path.abspath(os.path.join(rootDir,'../../py'))
rootthisfiledir = rootDir
rootDir = os.path.abspath(os.path.join(rootDir, "../../py"))
if sys.argv[1] == "loadversion":
os.chdir(rootDir)
with open("../cpp/version.cmake", "r", encoding="utf8") as ff:
@ -193,6 +193,7 @@ def get_url_as_json(url):
except:
time.sleep(3)
def buildPlugins(arch):
os.chdir(rootDir + "\\..\\cpp\\scripts")
subprocess.run("python fetchwebview2.py")
@ -215,10 +216,7 @@ def buildPlugins(arch):
def downloadsomething():
os.chdir(rootDir + "\\temp")
subprocess.run(f"curl -LO {mylinks['themes.zip']}")
subprocess.run(f"7z x themes.zip -oALL")
move_directory_contents("ALL/themes", rootDir + "\\files\\themes")
shutil.rmtree(rootDir + "\\files\\LunaTranslator_qss\\.git")
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\\unittest"))
# 放弃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":
createPluginDirs()
downloadsomething()
@ -294,20 +294,24 @@ if __name__ == "__main__":
)
os.chdir(rootDir + "/../cpp/scripts")
os.makedirs('../../py/files/plugins/DLL32',exist_ok=True)
shutil.copy('../builds/_x86/shareddllproxy32.exe','../../py/files/plugins')
shutil.copy('../builds/_x86/winrtutils32.dll','../../py/files/plugins/DLL32')
shutil.copy('../builds/_x86/winsharedutils32.dll','../../py/files/plugins/DLL32')
shutil.copy('../builds/_x86/wcocr.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/_x64/shareddllproxy64.exe','../../py/files/plugins')
shutil.copy('../builds/_x64/hookmagpie.dll','../../py/files/plugins')
shutil.copy('../builds/_x64/winrtutils64.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')
os.makedirs("../../py/files/plugins/DLL32", exist_ok=True)
shutil.copy("../builds/_x86/shareddllproxy32.exe", "../../py/files/plugins")
shutil.copy("../builds/_x86/winrtutils32.dll", "../../py/files/plugins/DLL32")
shutil.copy(
"../builds/_x86/winsharedutils32.dll", "../../py/files/plugins/DLL32"
)
shutil.copy("../builds/_x86/wcocr.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/_x64/shareddllproxy64.exe", "../../py/files/plugins")
shutil.copy("../builds/_x64/hookmagpie.dll", "../../py/files/plugins")
shutil.copy("../builds/_x64/winrtutils64.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":
os.chdir(rootDir)
os.system(f"python {os.path.join(rootthisfiledir,'collectall.py')} 32")

View File

@ -73,6 +73,8 @@ jobs:
fname: LunaTranslator
steps:
- 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
with:
path: build

View File

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