MCPcopy Index your code
hub / github.com/bugy/script-server / load_script_code

Method load_script_code

src/config/config_service.py:160–170  ·  view source on GitHub ↗
(self, script_name, user)

Source from the content-addressed store, hash-verified

158 shutil.move(path, unique_archive_file_path)
159
160 def load_script_code(self, script_name, user):
161 if not self._authorizer.can_edit_code(user.user_id):
162 logging.warning('User ' + str(user) + ' is not allowed to edit code')
163 raise InvalidAccessException('Code edit is not allowed for this user')
164
165 config_wrapper = self.load_config(script_name, user)
166 if config_wrapper is None:
167 return None
168
169 config = config_wrapper.get('config')
170 return self._load_script_code_by_config(config)
171
172 def _load_script_code_by_config(self, plain_config):
173 script_path = plain_config.get(SCRIPT_PATH_FIELD)

Callers 3

assert_script_codeMethod · 0.80
getMethod · 0.80

Calls 5

load_configMethod · 0.95
can_edit_codeMethod · 0.80
getMethod · 0.45

Tested by 2

assert_script_codeMethod · 0.64