20 lines
635 B
Python
20 lines
635 B
Python
from pathlib import Path
|
|||
|
|
|
||
|
|
root = Path(__file__).resolve().parents[2]
|
||
|
|
reps = [
|
||
|
|
("AdvisorAuthContext", "AdvisorAuthContext"),
|
||
|
|
("ScriptTemplateRepository", "ScriptTemplateRepository"),
|
||
|
|
(
|
||
|
|
"from app.service.script_template_service import ScriptTemplateService",
|
||
|
|
"from app.service.script_template_service import ScriptTemplateService",
|
||
|
|
),
|
||
|
|
]
|
||
|
|
for p in list(root.glob("app/**/*.py")) + list(root.glob("scripts/**/*.py")):
|
||
|
|
t = p.read_text(encoding="utf-8")
|
||
|
|
o = t
|
||
|
|
for a, b in reps:
|
||
|
|
t = t.replace(a, b)
|
||
|
|
if t != o:
|
||
|
|
p.write_text(t, encoding="utf-8")
|
||
|
|
print(p.relative_to(root))
|