Skip to content

Commit

Permalink
缩小文件
Browse files Browse the repository at this point in the history
  • Loading branch information
lilingfengdev committed Jun 1, 2024
1 parent 2258335 commit 7e92ce6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 2 additions & 3 deletions generate-bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
zip.extract("upx-4.2.3-win32/upx.exe", path=os.getcwd())
shutil.move("upx-4.2.3-win32/upx.exe", os.path.join(os.getcwd(), "upx.exe"))
os.mkdir("dist")
with open("utils.py", "r", encoding="utf8") as util:
util_context = util.read()
for file in os.listdir(os.getcwd()):
if file != "utils.py" and file != "generate-bundle.py" and file.endswith(".py") and not os.path.isdir(file):
print(f"build {file}", flush=True)
PyInstaller.__main__.run(["-F", file, "--optimize", "2", "-i", "favicon.ico"])
PyInstaller.__main__.run(["-F", file, "--optimize", "2", "-i", "favicon.ico", "--exclude-module",
"charset_normalizer,_ctypes,_decimal,_hashlib,_bz2,_lzma,pyexpat", ])

# 傻逼
# 狗屎代碼
5 changes: 4 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
import tqdm
import yaml
import traceback
from yaml import CLoader as Loader, CDumper as Dumper
from yaml import CLoader as Loader
import warnings

warnings.filterwarnings("ignore")


def script_license():
Expand Down

0 comments on commit 7e92ce6

Please sign in to comment.