промежуточный этап. Работает.

This commit is contained in:
2026-08-04 22:54:00 +03:00
parent 4ee7bd3a3d
commit 0fd145df88
10 changed files with 235 additions and 70 deletions
+3 -3
View File
@@ -19,7 +19,7 @@ def update_file_imports(filepath):
for mod in service_modules:
new_content = new_content.replace(f"from modules.{mod}", f"from services.{mod}")
new_content = new_content.replace(f"import modules.{mod}", f"import services.{mod}")
# Также на случай относительных или прямых импортов внутри сервисов друг на друга
# Замена для прямых импортов между модулями внутри папки services/
new_content = new_content.replace(f"from {mod}", f"from services.{mod}")
if content != new_content:
@@ -33,9 +33,9 @@ def run_update():
if "venv" in root or ".git" in root:
continue
for file in files:
if file.endswith(".py") and file != "migrate_structure.py" and file != "update_imports.py":
if file.endswith(".py") and file not in ["migrate_structure.py", "update_imports.py"]:
update_file_imports(os.path.join(root, file))
print("=== Обновление завершено ===")
print("=== Обновление импортов успешно завершено ===")
if __name__ == "__main__":
run_update()