代码初始化
This commit is contained in:
1 parent
c2f5cd98ff
commit
e3efeb74ad
2439 files changed
+305661
-1
No files matched your search
@@ -0,0 +1,30 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import zipfile, json, os, sys, io
|
||||
|
||||
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
||||
|
||||
BASE = r'e:\MCStudioDownload\work\3027246179@qq.com\Cpp\AddOn\0aaaa4f2f16c46e8964025a5ab0ecc02\_sa_hanhua_out'
|
||||
JARS = ['sa_essentials-forge-1.20.1-1.0.0.jar', 'sa_lib-forge-1.20.1-1.0.1.jar', 'sa_decor-forge-1.20.1-1.0.3.jar']
|
||||
|
||||
OUT = os.path.join(BASE, '_tmp', 'herb_dump2')
|
||||
os.makedirs(OUT, exist_ok=True)
|
||||
|
||||
KEY = 'herb'
|
||||
|
||||
for jn in JARS:
|
||||
jp = os.path.join(BASE, jn)
|
||||
if not os.path.exists(jp):
|
||||
continue
|
||||
z = zipfile.ZipFile(jp)
|
||||
for n in z.namelist():
|
||||
if KEY in n.lower() and not n.endswith('/'):
|
||||
dest = os.path.join(OUT, jn.replace('.jar', ''), *n.split('/'))
|
||||
os.makedirs(os.path.dirname(dest), exist_ok=True)
|
||||
with open(dest, 'wb') as f:
|
||||
f.write(z.read(n))
|
||||
z.close()
|
||||
|
||||
print('dumped to', OUT)
|
||||
for root, dirs, files in os.walk(OUT):
|
||||
for f in files:
|
||||
print(os.path.join(root, f))
|
||||
Reference in new issue
Block a user