代码初始化
This commit is contained in:
1 parent
c2f5cd98ff
commit
e3efeb74ad
2439 files changed
+305661
-1
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import zipfile, json, os, re
|
||||
|
||||
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"]
|
||||
|
||||
for j in jars:
|
||||
p = os.path.join(base, j)
|
||||
if not os.path.exists(p):
|
||||
print("MISSING", j); continue
|
||||
print("=" * 40, j)
|
||||
with zipfile.ZipFile(p) as z:
|
||||
hits = [n for n in z.namelist() if 'herb' in n.lower()]
|
||||
print("-- entries with 'herb':")
|
||||
for n in hits:
|
||||
print(" ", n)
|
||||
# lang json files
|
||||
langs = [n for n in z.namelist() if n.lower().endswith('.json') and '/lang/' in n.lower()]
|
||||
for ln in langs:
|
||||
try:
|
||||
data = json.loads(z.read(ln).decode('utf-8', 'ignore'))
|
||||
except Exception as e:
|
||||
print(" [lang parse fail]", ln, e); continue
|
||||
rel = [(k, v) for k, v in data.items() if 'herb' in k.lower() or (isinstance(v, str) and ('草' in v or 'herb' in v.lower()))]
|
||||
if rel:
|
||||
print("-- lang", ln, "(", len(rel), "hits )")
|
||||
for k, v in rel:
|
||||
print(" ", k, "=", v)
|
||||
Reference in new issue
Block a user