MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / __init__

Method __init__

bmtools/tools/shell/api.py:31–44  ·  view source on GitHub ↗

Initialize with stripping newlines.

(
        self,
        strip_newlines: bool = False,
        return_err_output: bool = False,
        persistent: bool = False,
    )

Source from the content-addressed store, hash-verified

29 """Executes bash commands and returns the output."""
30
31 def __init__(
32 self,
33 strip_newlines: bool = False,
34 return_err_output: bool = False,
35 persistent: bool = False,
36 ):
37 """Initialize with stripping newlines."""
38 self.strip_newlines = strip_newlines
39 self.return_err_output = return_err_output
40 self.prompt = ""
41 self.process = None
42 if persistent:
43 self.prompt = str(uuid4())
44 self.process = self._initialize_persistent_process(self.prompt)
45
46 @staticmethod
47 def _initialize_persistent_process(prompt: str) -> pexpect.spawn:

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected