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"):
style = importlib.import_module(
"files.themes." + _fn[:-3]
"files.themes." + _fn[:-3].replace("/", ".")
).stylesheet()
elif _fn.endswith(".qss"):
with open(

View File

@ -6,5 +6,3 @@ import hashlib
import configparser
from wsgiref.handlers import format_date_time
from html.parser import HTMLParser
import qdarkstyle
import qdarktheme

View File

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

View File

@ -2,5 +2,3 @@ PyQt5==5.15.10
PyQt5-Qt5==5.15.2
webviewpy==1.2.0
pefile
qdarkstyle
pyqtdarktheme

View File

@ -218,18 +218,6 @@ copycheck(
),
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 = []
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():
os.chdir(rootDir + "\\temp")
downloadlr()
@ -108,19 +124,6 @@ def downloadcommon():
)
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")
@ -193,8 +196,6 @@ def get_url_as_json(url):
time.sleep(3)
def buildLunaHook():
for ass in get_url_as_json(
"https://api.github.com/repos/HIllya51/LunaHook/releases/latest"
@ -238,12 +239,12 @@ def buildPlugins():
)
subprocess.run(f"python copytarget.py 0")
def downloadsomething():
os.chdir(rootDir + "\\temp")
os.system('git clone https://github.com/HIllya51/stylesheets')
for f in os.listdir('stylesheets'):
if os.path.isfile(os.path.join('stylesheets',f)):
shutil.copy(os.path.join('stylesheets',f),rootDir + "\\LunaTranslator\\files\\themes")
os.system("git clone https://github.com/HIllya51/stylesheets")
move_directory_contents("stylesheets", rootDir + "\\LunaTranslator\\files\\themes")
if __name__ == "__main__":
if sys.argv[1] == "loadversion":
@ -258,7 +259,7 @@ if __name__ == "__main__":
arch = sys.argv[1]
isdebug = len(sys.argv) > 2 and int(sys.argv[2])
os.chdir(rootDir)
os.system('git submodule update --init --recursive')
os.system("git submodule update --init --recursive")
os.makedirs("temp", exist_ok=True)
createPluginDirs()