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

Method get

src/web/server.py:188–202  ·  view source on GitHub ↗
(self, user, script_name)

Source from the content-addressed store, hash-verified

186 @requires_admin_rights
187 @inject_user
188 def get(self, user, script_name):
189 try:
190 config = self.application.config_service.load_config(script_name, user)
191 except ConfigNotAllowedException:
192 LOGGER.warning('Admin access to the script "' + script_name + '" is denied for ' + user.get_audit_name())
193 respond_error(self, 403, 'Access to the script is denied')
194 return
195 except CorruptConfigFileException as e:
196 respond_error(self, CorruptConfigFileException.HTTP_CODE, str(e))
197 return
198
199 if config is None:
200 raise tornado.web.HTTPError(404, str('Failed to find config for name: ' + script_name))
201
202 self.write(json.dumps(config))
203
204 @requires_admin_rights
205 @inject_user

Callers

nothing calls this directly

Calls 4

respond_errorFunction · 0.90
load_configMethod · 0.80
get_audit_nameMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected