feat:一些版权描述的语言
Some checks failed
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled
Some checks failed
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled
This commit is contained in:
42
tools/icon_work/scan_attr.py
Normal file
42
tools/icon_work/scan_attr.py
Normal file
@ -0,0 +1,42 @@
|
||||
|
||||
import os, re
|
||||
|
||||
ROOT = r"D:\Project\Starlight_Lancher"
|
||||
DIRS = [
|
||||
"apps/app-frontend/src",
|
||||
"packages/ui/src",
|
||||
"packages/app-lib/src",
|
||||
"apps/app/src",
|
||||
]
|
||||
KEYWORDS = re.compile(
|
||||
r"Copyright|All Rights|Powered by|attribution|Attribution|"
|
||||
r"modified version|based on|版权所有|版权归|署名|致谢|鸣谢|"
|
||||
r"credit|Credit|acknowledg|Acknowledg",
|
||||
re.I,
|
||||
)
|
||||
|
||||
hits = []
|
||||
for d in DIRS:
|
||||
base = os.path.join(ROOT, d)
|
||||
if not os.path.isdir(base):
|
||||
continue
|
||||
for dp, dn, fn in os.walk(base):
|
||||
dn[:] = [x for x in dn if x not in ("node_modules", "dist", "target", ".git")]
|
||||
for f in fn:
|
||||
if not f.endswith((".ts", ".vue", ".rs", ".js", ".json")):
|
||||
continue
|
||||
p = os.path.join(dp, f)
|
||||
if "locales" in p and not p.endswith("en-US/index.json") and not p.endswith("zh-CN/index.json"):
|
||||
continue
|
||||
try:
|
||||
lines = open(p, encoding="utf-8").read().split("\n")
|
||||
except Exception:
|
||||
continue
|
||||
for i, line in enumerate(lines, 1):
|
||||
if "Starlight" in line and KEYWORDS.search(line):
|
||||
hits.append((os.path.relpath(p, ROOT), i, line.strip()))
|
||||
|
||||
print(f"含版权/归属性质且提到 Starlight 的行:{len(hits)}\n")
|
||||
for h in hits:
|
||||
print(f"{h[0]}:{h[1]}")
|
||||
print(f" {h[2][:160]}")
|
||||
Reference in New Issue
Block a user