Files
wehub-resource-sync 4e0f4422d0
build-docs / deploy (push) Has been cancelled
Check Markdown links / markdown-link-check (push) Has been cancelled
Pytest / test (3.11) (push) Has been cancelled
Pytest / test (3.12) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:25:42 +08:00

29 lines
835 B
Python

from collections.abc import Callable
from sweagent.environment.hooks.abstract import EnvHook
from sweagent.environment.repo import Repo, RepoConfig
class SetStatusEnvironmentHook(EnvHook):
def __init__(self, id: str, callable: Callable[[str, str], None]):
self._callable = callable
self._id = id
def _update(self, message: str):
self._callable(self._id, message)
def on_copy_repo_started(self, repo: RepoConfig | Repo):
self._update(f"Copying repo {repo.repo_name}")
def on_start_deployment(self):
self._update("Starting deployment")
def on_install_env_started(self):
self._update("Installing environment")
def on_environment_startup(self):
self._update("Starting environment")
def on_close(self):
self._update("Closing environment")