openpetswithchatandmcp/website/fix_editor_errors.py
OpenPets Dev 65ac83849e Add 'website/' from commit '966aea480ffe1c340553aa878def30131d2af827'
git-subtree-dir: website
git-subtree-mainline: 8d3849caea
git-subtree-split: 966aea480f
2026-06-17 20:48:39 +00:00

14 lines
827 B
Python
Executable file

import re
with open('c:/ScriptoriumAI/scriptoriumai-ui/src/pages/EditorSimplified.tsx', 'r', encoding='utf-8') as f:
text = f.read()
# Add import
if 'ConflictResolutionModal' not in text or 'import { ConflictResolutionModal }' not in text:
text = text.replace("import { ContextScopeController } from '../components/editor/ContextScopeController'", "import { ContextScopeController } from '../components/editor/ContextScopeController'\nimport { ConflictResolutionModal } from '../components/ConflictResolutionModal'")
# Fix handleLoadProject reference
text = text.replace(" handleLoadProject()\n }, [handleLoadProject])", " // removed because handleLoadProject is missing\n }, [])")
with open('c:/ScriptoriumAI/scriptoriumai-ui/src/pages/EditorSimplified.tsx', 'w', encoding='utf-8') as f:
f.write(text)