MCPcopy Create free account
hub / github.com/EasyIME/PIME / render_linked_js

Method render_linked_js

python/python3/tornado/web.py:925–946  ·  view source on GitHub ↗

Default method used to render the final js links for the rendered webpage. Override this method in a sub-classed controller to change the output.

(self, js_files: Iterable[str])

Source from the content-addressed store, hash-verified

923 return self.finish(html)
924
925 def render_linked_js(self, js_files: Iterable[str]) -> str:
926 """Default method used to render the final js links for the
927 rendered webpage.
928
929 Override this method in a sub-classed controller to change the output.
930 """
931 paths = []
932 unique_paths = set() # type: Set[str]
933
934 for path in js_files:
935 if not is_absolute(path):
936 path = self.static_url(path)
937 if path not in unique_paths:
938 paths.append(path)
939 unique_paths.add(path)
940
941 return "".join(
942 '<script src="'
943 + escape.xhtml_escape(p)
944 + '" type="text/javascript"></script>'
945 for p in paths
946 )
947
948 def render_embed_js(self, js_embed: Iterable[bytes]) -> bytes:
949 """Default method used to render the final embedded js for the

Callers 1

renderMethod · 0.95

Calls 5

static_urlMethod · 0.95
is_absoluteFunction · 0.85
joinMethod · 0.80
appendMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected