MCPcopy Create free account
hub / github.com/crewAIInc/crewAI / _StartedRun

Class _StartedRun

lib/cli/tests/test_cli.py:414–435  ·  view source on GitHub ↗

A `crewai run` that create started. Ctrl-C interrupts create's wait for it ``interrupts`` times, then the run ends with ``returncode``.

Source from the content-addressed store, hash-verified

412
413
414class _StartedRun:
415 """A `crewai run` that create started. Ctrl-C interrupts create's wait for it
416 ``interrupts`` times, then the run ends with ``returncode``."""
417
418 def __init__(self, args, kwargs, returncode: int, interrupts: int) -> None:
419 self.args = args
420 self.cwd = kwargs.get("cwd")
421 self.env = kwargs.get("env")
422 self.killed = False
423 self._returncode = returncode
424 self._interrupts = interrupts
425
426 def wait(self) -> int:
427 if self._interrupts:
428 self._interrupts -= 1
429 raise KeyboardInterrupt
430 return self._returncode
431
432 def kill(self) -> None:
433 self.killed = True
434
435 terminate = kill
436
437
438def _record_runs(

Callers 1

fake_popenFunction · 0.85

Calls

no outgoing calls

Tested by 1

fake_popenFunction · 0.68