MCPcopy
hub / github.com/bugy/script-server / start

Method start

src/execution/executor.py:64–91  ·  view source on GitHub ↗
(self, execution_id)

Source from the content-addressed store, hash-verified

62 self.protected_output_stream = None
63
64 def start(self, execution_id):
65 if self.process_wrapper is not None:
66 raise Exception('Executor already started')
67
68 parameter_values = self.get_script_parameter_values()
69
70 script_args = build_command_args(parameter_values, self.config)
71 command = self.script_base_command + script_args
72 env_variables = _build_env_variables(parameter_values, self.config.parameters, execution_id)
73
74 all_env_variables = self._env_vars.build_env_vars(env_variables)
75
76 process_wrapper = _process_creator(self, command, self._working_directory, all_env_variables)
77 process_wrapper.start()
78
79 self.process_wrapper = process_wrapper
80
81 output_stream = process_wrapper.output_stream.time_buffered(TIME_BUFFER_MS, _concat_output)
82 self.raw_output_stream = output_stream.replay()
83
84 send_stdin_parameters(self.config.parameters, parameter_values, self.raw_output_stream, process_wrapper)
85
86 if self.secure_replacements:
87 self.protected_output_stream = output_stream \
88 .map(self.__replace_secure_variables) \
89 .replay()
90 else:
91 self.protected_output_stream = self.raw_output_stream
92
93 def __init_secure_replacements(self):
94 word_replacements = {}

Callers 15

start_scriptMethod · 0.95
__init__Method · 0.45
run_syncFunction · 0.45
_start_schedulerMethod · 0.45
_start_timerFunction · 0.45
__init__Method · 0.45
sendMethod · 0.45
testMethod · 0.45
test_openMethod · 0.45
test_closeMethod · 0.45
test_simple_logMethod · 0.45

Calls 8

build_command_argsFunction · 0.85
_build_env_variablesFunction · 0.85
send_stdin_parametersFunction · 0.85
build_env_varsMethod · 0.80
time_bufferedMethod · 0.80
mapMethod · 0.80
replayMethod · 0.45

Tested by 15

testMethod · 0.36
test_openMethod · 0.36
test_closeMethod · 0.36
test_simple_logMethod · 0.36
test_multiple_logsMethod · 0.36
test_caret_returnMethod · 0.36
setUpMethod · 0.36