This commit is contained in:
恍兮惚兮 2024-05-29 02:09:31 +08:00
parent 61683a940f
commit c8edc14c1d
6 changed files with 33 additions and 48 deletions

View File

@ -859,7 +859,7 @@ class MAINUI:
if _fn.endswith(".py"): if _fn.endswith(".py"):
style = importlib.import_module( style = importlib.import_module(
"files.themes." + _fn[:-3] "files.themes." + _fn[:-3].replace("/", ".")
).stylesheet() ).stylesheet()
elif _fn.endswith(".qss"): elif _fn.endswith(".qss"):
with open( with open(

View File

@ -5,6 +5,4 @@ import xml.etree.ElementTree as ET
import hashlib import hashlib
import configparser import configparser
from wsgiref.handlers import format_date_time from wsgiref.handlers import format_date_time
from html.parser import HTMLParser from html.parser import HTMLParser
import qdarkstyle
import qdarktheme

View File

@ -2,37 +2,37 @@
"themes": { "themes": {
"dark": [ "dark": [
{ {
"file": "dark1.py", "file": "PyQtDarkTheme/dark.py",
"name": "PyQtDarkTheme" "name": "PyQtDarkTheme"
}, },
{ {
"file": "dark2.py", "file": "QDarkStyleSheet/dark.py",
"name": "QDarkStyleSheet" "name": "QDarkStyleSheet"
}, },
{ {
"file": "dark3.py", "file": "BreezeStyleSheets/dark.py",
"name": "BreezeStyleSheets" "name": "BreezeStyleSheets"
}, },
{ {
"file": "dark_win11like.py", "file": "QTWin11/dark.py",
"name": "QTWin11" "name": "QTWin11"
} }
], ],
"light": [ "light": [
{ {
"file": "light1.py", "file": "PyQtDarkTheme/light.py",
"name": "PyQtDarkTheme" "name": "PyQtDarkTheme"
}, },
{ {
"file": "light2.py", "file": "QDarkStyleSheet/light.py",
"name": "QDarkStyleSheet" "name": "QDarkStyleSheet"
}, },
{ {
"file": "light3.py", "file": "BreezeStyleSheets/light.py",
"name": "BreezeStyleSheets" "name": "BreezeStyleSheets"
}, },
{ {
"file": "light_win11like.py", "file": "QTWin11/light.py",
"name": "QTWin11" "name": "QTWin11"
} }
] ]

View File

@ -1,6 +1,4 @@
PyQt5==5.15.10 PyQt5==5.15.10
PyQt5-Qt5==5.15.2 PyQt5-Qt5==5.15.2
webviewpy==1.2.0 webviewpy==1.2.0
pefile pefile
qdarkstyle
pyqtdarktheme

View File

@ -218,18 +218,6 @@ copycheck(
), ),
os.path.join(runtime, "PyQt5/Qt5/plugins/styles"), os.path.join(runtime, "PyQt5/Qt5/plugins/styles"),
) )
copycheck(
os.path.join(
py37Path, "Lib/site-packages/qdarktheme"
),
os.path.join(runtime),
)
copycheck(
os.path.join(
py37Path, "Lib/site-packages/qdarkstyle"
),
os.path.join(runtime),
)
collect = [] collect = []
for _dir, _, fs in os.walk(targetdir): for _dir, _, fs in os.walk(targetdir):

View File

@ -92,6 +92,22 @@ def downloadlr():
) )
def move_directory_contents(source_dir, destination_dir):
contents = os.listdir(source_dir)
for item in contents:
if item == ".git":
continue
item_path = os.path.join(source_dir, item)
try:
shutil.move(item_path, destination_dir)
except:
for k in os.listdir(item_path):
shutil.move(
os.path.join(item_path, k), os.path.join(destination_dir, item)
)
def downloadcommon(): def downloadcommon():
os.chdir(rootDir + "\\temp") os.chdir(rootDir + "\\temp")
downloadlr() downloadlr()
@ -108,19 +124,6 @@ def downloadcommon():
) )
subprocess.run(f"7z x magpie.zip -oALL") subprocess.run(f"7z x magpie.zip -oALL")
def move_directory_contents(source_dir, destination_dir):
contents = os.listdir(source_dir)
for item in contents:
item_path = os.path.join(source_dir, item)
try:
shutil.move(item_path, destination_dir)
except:
for k in os.listdir(item_path):
shutil.move(
os.path.join(item_path, k), os.path.join(destination_dir, item)
)
move_directory_contents("ALL/ALL", f"{rootDir}/LunaTranslator/files/plugins") move_directory_contents("ALL/ALL", f"{rootDir}/LunaTranslator/files/plugins")
@ -192,8 +195,6 @@ def get_url_as_json(url):
except: except:
time.sleep(3) time.sleep(3)
def buildLunaHook(): def buildLunaHook():
for ass in get_url_as_json( for ass in get_url_as_json(
@ -238,13 +239,13 @@ def buildPlugins():
) )
subprocess.run(f"python copytarget.py 0") subprocess.run(f"python copytarget.py 0")
def downloadsomething(): def downloadsomething():
os.chdir(rootDir + "\\temp") os.chdir(rootDir + "\\temp")
os.system('git clone https://github.com/HIllya51/stylesheets') os.system("git clone https://github.com/HIllya51/stylesheets")
for f in os.listdir('stylesheets'): move_directory_contents("stylesheets", rootDir + "\\LunaTranslator\\files\\themes")
if os.path.isfile(os.path.join('stylesheets',f)):
shutil.copy(os.path.join('stylesheets',f),rootDir + "\\LunaTranslator\\files\\themes")
if __name__ == "__main__": if __name__ == "__main__":
if sys.argv[1] == "loadversion": if sys.argv[1] == "loadversion":
os.chdir(rootDir) os.chdir(rootDir)
@ -258,7 +259,7 @@ if __name__ == "__main__":
arch = sys.argv[1] arch = sys.argv[1]
isdebug = len(sys.argv) > 2 and int(sys.argv[2]) isdebug = len(sys.argv) > 2 and int(sys.argv[2])
os.chdir(rootDir) os.chdir(rootDir)
os.system('git submodule update --init --recursive') os.system("git submodule update --init --recursive")
os.makedirs("temp", exist_ok=True) os.makedirs("temp", exist_ok=True)
createPluginDirs() createPluginDirs()