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

Class _StartedRun

lib/cli/tests/test_cli.py:421–442  ·  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

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

Callers 1

fake_popenFunction · 0.85

Calls

no outgoing calls

Tested by 1

fake_popenFunction · 0.68