refactor: Move balance tool classes to standard package structure (Package-by-Layer)
This commit is contained in:
24
fix_mcptool.py
Normal file
24
fix_mcptool.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import os
|
||||
import re
|
||||
|
||||
pattern = re.compile(r'name\s*=\s*"[^"]*",\s*description\s*=\s*"[^"]*",\s*group\s*=\s*"[^"]*",?\s*')
|
||||
|
||||
for root, _, files in os.walk('.'):
|
||||
for f in files:
|
||||
if f.endswith('.java'):
|
||||
p = os.path.join(root, f)
|
||||
try:
|
||||
content = open(p, encoding='utf-8').read()
|
||||
except Exception:
|
||||
content = open(p, encoding='cp949').read()
|
||||
|
||||
new_content = pattern.sub('', content)
|
||||
|
||||
# Clean up empty parens like @McpTool()
|
||||
new_content = new_content.replace('@McpTool(\n \n)', '@McpTool')
|
||||
new_content = new_content.replace('@McpTool()', '@McpTool')
|
||||
|
||||
if content != new_content:
|
||||
with open(p, 'w', encoding='utf-8') as out:
|
||||
out.write(new_content)
|
||||
print(f"Updated {p}")
|
||||
Reference in New Issue
Block a user