mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
shrink
This commit is contained in:
parent
61683a940f
commit
c8edc14c1d
@ -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(
|
||||
|
@ -5,6 +5,4 @@ import xml.etree.ElementTree as ET
|
||||
import hashlib
|
||||
import configparser
|
||||
from wsgiref.handlers import format_date_time
|
||||
from html.parser import HTMLParser
|
||||
import qdarkstyle
|
||||
import qdarktheme
|
||||
from html.parser import HTMLParser
|
@ -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"
|
||||
}
|
||||
]
|
||||
|
@ -1,6 +1,4 @@
|
||||
PyQt5==5.15.10
|
||||
PyQt5-Qt5==5.15.2
|
||||
webviewpy==1.2.0
|
||||
pefile
|
||||
qdarkstyle
|
||||
pyqtdarktheme
|
||||
pefile
|
@ -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):
|
||||
|
43
build.py
43
build.py
@ -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")
|
||||
|
||||
|
||||
@ -192,8 +195,6 @@ def get_url_as_json(url):
|
||||
except:
|
||||
time.sleep(3)
|
||||
|
||||
|
||||
|
||||
|
||||
def buildLunaHook():
|
||||
for ass in get_url_as_json(
|
||||
@ -238,13 +239,13 @@ 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":
|
||||
os.chdir(rootDir)
|
||||
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user