MCPcopy
hub / github.com/WebODM/WebODM / get_dynamic_script

Method get_dynamic_script

app/plugins/plugin_base.py:243–256  ·  view source on GitHub ↗

Retrieves a view handler that serves a dynamic script from the plugin's directory. Dynamic scripts are normal Javascript files that optionally support Template variable substitution via ${vars}, computed on the server. :param script_path: path to script relat

(self, script_path, callback = None, **template_args)

Source from the content-addressed store, hash-verified

241 return True
242
243 def get_dynamic_script(self, script_path, callback = None, **template_args):
244 """
245 Retrieves a view handler that serves a dynamic script from
246 the plugin's directory. Dynamic scripts are normal Javascript
247 files that optionally support Template variable substitution
248 via ${vars}, computed on the server.
249 :param script_path: path to script relative to plugin's directory.
250 :param callback: optional callback. The callback can prevent the script from being returned if it returns False.
251 If it returns a dictionary, the dictionary items are used for variable substitution.
252 :param template_args: Parameters to use for variable substitution (unless a callback is specified)
253 :return: Django view
254 """
255 from app.plugins import get_dynamic_script_handler
256 return get_dynamic_script_handler(self.get_path(script_path), callback, **template_args)
257
258 def get_manifest(self):
259 # Lazy loading

Callers 1

app_mount_pointsMethod · 0.80

Calls 2

get_pathMethod · 0.95

Tested by

no test coverage detected