23 lines
841 B
Python
23 lines
841 B
Python
import os
|
|
|
|
def fix_sf(path):
|
|
with open(path, 'r') as f:
|
|
lines = f.readlines()
|
|
new_lines = []
|
|
for line in lines:
|
|
if "from services.bot_service import _skills_root" in line: continue
|
|
if "from services.bot_service import _workspace_root" in line: continue
|
|
new_lines.append(line)
|
|
|
|
# Add corrected imports at the top
|
|
if path.endswith("skill_service.py"):
|
|
new_lines.insert(20, "from services.bot_service import _skills_root, _workspace_root\n")
|
|
elif path.endswith("workspace_service.py"):
|
|
new_lines.insert(20, "from services.bot_service import _workspace_root\n")
|
|
|
|
with open(path, 'w') as f:
|
|
f.writelines(new_lines)
|
|
|
|
# Wait, if _skills_root is defined in skill_service.py, it shouldn't be imported from bot_service.
|
|
# Let's check where it IS defined.
|