MCPcopy Index your code
hub / github.com/AstrBotDevs/AstrBot / _run

Method _run

astrbot/core/computer/booters/local.py:210–216  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

208 self, path: str, content: str = "", mode: int = 0o644
209 ) -> dict[str, Any]:
210 def _run() -> dict[str, Any]:
211 abs_path = os.path.abspath(path)
212 os.makedirs(os.path.dirname(abs_path), exist_ok=True)
213 with open(abs_path, "w", encoding="utf-8") as f:
214 f.write(content)
215 os.chmod(abs_path, mode)
216 return {"success": True, "path": abs_path}
217
218 return await asyncio.to_thread(_run)
219

Callers

nothing calls this directly

Calls 8

detect_text_encodingFunction · 0.90
searchFunction · 0.85
_truncate_long_linesFunction · 0.85
startswithMethod · 0.80
writeMethod · 0.45
readMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected