MCPcopy Create free account
hub / github.com/bugy/script-server / _read_preload_script_conf

Method _read_preload_script_conf

src/model/script_config.py:316–337  ·  view source on GitHub ↗
(self, config)

Source from the content-addressed store, hash-verified

314 return merged_dict
315
316 def _read_preload_script_conf(self, config):
317 if config is None:
318 return None
319
320 error_message = 'Failed to load preload script for ' + self.name + ': '
321
322 if not isinstance(config, dict):
323 logging.warning(error_message + 'should be dict')
324 return None
325
326 script = config.get('script')
327 if is_empty(script):
328 logging.warning(error_message + 'missing "script" field')
329 return
330
331 try:
332 format = read_output_format(config)
333 except InvalidConfigException:
334 LOGGER.warning(error_message + 'invalid format specified')
335 format = OUTPUT_FORMAT_TERMINAL
336
337 return {'script': script, 'output_format': format}
338
339 def run_preload_script(self):
340 if not self.preload_script:

Callers 1

_reload_configMethod · 0.95

Calls 3

is_emptyFunction · 0.90
read_output_formatFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected